Newbie need help on JPanel graphics
need your help. i'm so struggling on this program that i have to do. here's my scenario:
1) i have a frame that is divided by two JPanels, the left and right.
2) the right are subdivided by multiple jpanels and contains buttons and text.
when a button is pressed, it creates a text on the right panel.
3) the right works ok.
4) the left is "not" subdivided. it contains a couple of simple straight lines. and a clored background.
5) what i want to do is: to add additional lines to my left panel when a particular button is pressed from the right panel.
6) thats where im stuck. i'm played around with it but it either make my left drawings disappear or it makes a new panel. h
here's part of my code:
//this is in a different file.
public class LeftSide extends JPanel
public void paintComponent(Graphics g)
public void paint(Graphics g)
g.drawLine(275, 50, 275, 500);
//this is also in a separate file.
private void createBodyGUIs()
LeftSide drawings = new LeftSide();
createRightColumnGUI(); //creates my goodies on the right side
thanks in advance!