Results 1 to 6 of 6
- 02-21-2010, 01:20 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 3
- Rep Power
- 0
Handle Resizing of Swing Containers
Hello,
I hope you know the answer to my beginner question -- I have a JButton, which has an Image drawn to it. Now I tried to apply a Layout to this Button and the whole rest of my formular, and this works fairly good. The Button is resizing when I resize the Window. But I wish to make the Image on the Button smaller, when the Button shrinks, and bigger, when the button gets bigger. Is there any possibility to do this without too much hassle? Is there an autofit setting, or another way to get notified anytime the button gets resized?
When there is such a notification: How do I get the size the button is tried to be resized to? Just with getSize()?
And talking about "best practice" -- yea, what would the best practice be here?
I hope this question doesn't annoy you too much; I am a total GUI beginner :/
Thank you very much!
Simon L.
- 02-21-2010, 03:31 AM #2
Member
- Join Date
- Jul 2008
- Posts
- 62
- Rep Power
- 0
> I hope this question doesn't annoy you too much
the question doesn't, the cross-posting does
Handle Resizing of Containers (Swing / AWT / SWT / JFace forum at JavaRanch)
-
Yup, both JavaRanch and we have a policy regarding cross-posting. It's always a good policy to read the FAQ's before posting. For instance: BeForthrightWhenCrossPostingToOtherSites
- 02-21-2010, 11:50 AM #4
Member
- Join Date
- Feb 2010
- Posts
- 3
- Rep Power
- 0
I'm sorry, I didn't know this is discouraged. Do you have an answer for me, though?
- 02-21-2010, 06:46 PM #5
Member
- Join Date
- Jul 2008
- Posts
- 62
- Rep Power
- 0
> ... I didn't know this is discouraged.
so, common scenario -
someone tries to help you in your unanswered post
your post in another forum was answered (possibly) hours earlier
the 'someone' has had their time totally wasted
and you're happy with the above!
> Do you have an answer for me, though?
I posted the answer at javaranch (then deleted it when I saw the cross-post here)
my time is unimportant to you, therefore you getting a solution is unimportant to me
- 02-23-2010, 02:20 AM #6
Member
- Join Date
- Feb 2010
- Posts
- 3
- Rep Power
- 0
I, personally, wouldn't mind, if i would be the answer-giver. In real world, you ask multiple Persons about things, too, and dont waste your breath listing every single person you spoke with about your problem.
So, intuitively, I knever would have come to the idea, that such a rule exists.
And thanks for the help. I'm happy to waste even MORE of your time, because you seem to have big piles of it, reading this now. Searching crossposts. Thats not really the way to have a happy time -_-Last edited by simlei; 02-23-2010 at 02:22 AM.
Similar Threads
-
JFrame resizing
By carderne in forum New To JavaReplies: 3Last Post: 07-22-2009, 07:42 PM -
panel resizing
By kumar_gemi in forum New To JavaReplies: 3Last Post: 03-13-2009, 02:51 AM -
First Java-game: Containers
By eastviolence in forum New To JavaReplies: 0Last Post: 04-04-2008, 06:09 PM -
Swing containers
By Java Tip in forum Java TipReplies: 0Last Post: 12-07-2007, 12:06 PM -
Image resizing
By alley in forum Java 2DReplies: 2Last Post: 11-13-2007, 10:10 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks