|
-
January 31st, 2012, 10:34 AM
#16
Re: JTextField-Text Access
actually earlier i used "BorderLayout"....
but i put all my 3 buttons in south....
but i got only 1 button covering the whole south part of the frame....
and when i maximise my window it showed me all the buttons....
so that's why i decided to move them by myself....
-
January 31st, 2012, 11:23 AM
#17
Re: JTextField-Text Access
and i used them on JPanel....
Code:
panel1.add(tfield1,BorderLayout.PAGE_START);
i used this code....and i'm getting a flowlayout....
-
January 31st, 2012, 11:33 AM
#18
Re: JTextField-Text Access
With BorderLayout you can only put one component in any one region. If you want to add more than one component to a region you have to add the components to a container component such as JPanel and add the container component to the region.
So, if you want to add 3 buttons to the SOUTH region then you need to add those 3 buttons to a JPanel and add the JPanel to the SOUTH region. There are a number of layout managers you could use in the JPanel to layout the buttons but FlowLayout with a center alignment and small inter component spacing is probably the one you want. ie
Code:
new FlowLayout(FlowLayout.CENTER);
-
February 1st, 2012, 10:09 AM
#19
Re: JTextField-Text Access
got it....thanks a lot....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|