So I have a JFrame, in which it has a bunch of JPanel which is called venPanel. When I click on a venPanel I want the JFrame to add a new JPanel to the east of the layout (because the JFrame uses the border layout). How can I achieve this in my venPanel class? Currently the mouseClick action listener for the venPanel is implemented as:
@Override
public void mouseClicked(MouseEvent arg0) {
try {
GUIVenDetails vendetail = new GUIVenDetails(ven);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Where GUIVenDetails is the JPanel I wanted to add to the east of the JFrame..
I hope the question is clear..
Something like: