I am trying to draw bar and dot graphs in a JTabbedPane for an app I am making. I did some research and it seems other people are using the paintComponent(Graphics g) function to paint on all the visuals. However, I am not sure how to implement this function as a part of try{ from ActionListener. So when a button is clicked, a new Frame will appear for the Graphs.
JButton btnGraphs = new JButton("Graphs");
add(btnGraphs, "cell 1 5,alignx center");
btnGraphs.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
try {
} catch (Exception e) {
}
}
});