Â
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:-).
Artificial Intelligence (AI) agents have started becoming an integral part of our lives. Imagine asking…
In the ever-evolving landscape of agentic AI workflows and applications, understanding and leveraging design patterns…
In this blog, I aim to provide a comprehensive list of valuable resources for learning…
Have you ever wondered how systems determine whether to grant or deny access, and how…
What revolutionary technologies and industries will define the future of business in 2025? As we…
For data scientists and machine learning researchers, 2024 has been a landmark year in AI…
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);
}
}