java forums
Â
Not So Very Active Forums
Following are some other forums that could also be visited. However, they are not very active in the sense that not many discussion threads could be found which implies that not many visitors are there on these sites. Interestingly enough, Oracle Java forums fall in this list:-).
This blog represents a list of questions you can ask when thinking like a product…
AI agents are autonomous systems combining three core components: a reasoning engine (powered by LLM),…
Artificial Intelligence (AI) has evolved significantly, from its early days of symbolic reasoning to the…
Last updated: 25th Jan, 2025 Have you ever wondered how to seamlessly integrate the vast…
Hey there! As I venture into building agentic MEAN apps with LangChain.js, I wanted to…
Software-as-a-Service (SaaS) providers have long relied on traditional chatbot solutions like AWS Lex and Google…
View Comments
please help me to add 3 buttons in my application for each animated gif file. When I click a button the curresponding file should be display. Can you help any whay my working code as below....
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.*;
import java.awt.event.*;
public class Animation {
public static void main(String args[]) {
JLabel imageLabel = new JLabel();
JLabel headerLabel = new JLabel();
ImageIcon ico = new ImageIcon("Icon1.png");
JButton click = new JButton(" ",ico);
JFrame frame = new JFrame("JFrame Animation");
JPanel jPanel = new JPanel();
jPanel.add(click);
//Add a window listner for close button
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// add the header label
headerLabel.setFont(new java.awt.Font("Comic Sans MS", Font.BOLD, 16));
//headerLabel.setText("Animated Image!");
jPanel.add(headerLabel, java.awt.BorderLayout.NORTH);
//frame.getContentPane().add(headerLabel, java.awt.BorderLayout.NORTH);
// add the image label
ImageIcon ii = new ImageIcon("Arnab.gif");
imageLabel.setIcon(ii);
jPanel.add(imageLabel, BorderLayout.CENTER);
frame.getContentPane().add(jPanel, java.awt.BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}