|
-
September 30th, 2011, 06:59 PM
#1
How to position widgets
When putting widgets like JList or Jbutton on containers like Jpanel , how does one set position as to where they are displayed ,
-
September 30th, 2011, 07:30 PM
#2
Re: How to position widgets
If you don't want to use one of the layout managers, Remove the layout manager and use one or more of the JComponent methods to set the components position.
Norm
-
September 30th, 2011, 09:19 PM
#3
Re: How to position widgets
which method to call to remove default layout manager ( flow layout ) , and which method of JComponent
to set position .
-
September 30th, 2011, 09:21 PM
#4
Re: How to position widgets
Have you read the API doc for the JComponent class to see what methods could be useful?
Are there any that deal with the layout manager or the location and size of the component?
Norm
-
October 1st, 2011, 05:41 AM
#5
Re: How to position widgets
which method to call to remove default layout manager ( flow layout )
My advice is don't do this. There are very few occasions where you need to manually position components - in all my years of programming in Java I never yet had a situation where I can't get a layout manager to do the job for me (admittedly I had to write my own layout manager on a couple of occasions but it's not that hard to do).
Using layout managers may seem a little complicated at first but once you get the hang of them the benefits are more than worth the effort.
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
|