Â
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:-).
In recent years, artificial intelligence (AI) has evolved to include more sophisticated and capable agents,…
Adaptive learning helps in tailoring learning experiences to fit the unique needs of each student.…
With the increasing demand for more powerful machine learning (ML) systems that can handle diverse…
Anxiety is a common mental health condition that affects millions of people around the world.…
In machine learning, confounder features or variables can significantly affect the accuracy and validity of…
Last updated: 26 Sept, 2024 Credit card fraud detection is a major concern for credit…
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);
}
}