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:-).
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…
Retrieval-Augmented Generation (RAG) is an innovative generative AI method that combines retrieval-based search with large…
The combination of Retrieval-Augmented Generation (RAG) and powerful language models enables the development of sophisticated…
Have you ever wondered how to use OpenAI APIs to create custom chatbots? With advancements…
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);
}
}