Laying out JPanels to make a simple GUI
- by Elvis
Hello, first of all, this is more or less my first GUI and ive learned Java for not more then a week, so it might contain some serious programming errors.
What i have right now is:
Buttons and labels are part of OptionPanel and are on the left, DrawingPanel is about 5x5 px in size and is on the right.
What I am trying to do is a simple test, to get me more familiar with the GUI. The rectangle should be movable and re-sizeable by the user when clicking the respective buttons:
http://www.upload.ee/image/612005/JFrame2.jpg
Right now i have:
JFrame MainFrame - Makes JFrame (Not using the setSize function. using .pack() instead. not sure about it)
JPanel MergedPanel - FlowLayout - Adds JPanel OptionsPanel and JPanel DrawingPanel together and gets injected to JFrame MainFrame
JPanel DrawPanel - This JPanel is responsible of drawing the rectangle.
JPanel OptionPanel - FlowLayout - This JPanel is responsible of the buttons.
Help please.