Laying out JPanels to make a simple GUI

Posted by Elvis on Stack Overflow See other posts from Stack Overflow or by Elvis
Published on 2010-06-02T08:22:27Z Indexed on 2010/06/02 8:23 UTC
Read the original article Hit count: 182

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about gui