Solved

Component size changes when I move to another L&F

Posted on 2001-06-19
5
194 Views
Last Modified: 2010-04-16
Hi,

I have a swing program that I just imported over to a unix box; I had programed the whole thing under windows. I noticed that some of my components, especially JButtons, are resized (shrunked height). Has anyone come across this problem? I have tried to set the preffered, max, and min size to the size I want but it still isn't working. I have used the setBounds() to set up the layout and size initially. How can I get around this? Also, I am using the getSystemLookAndFeel() method to set up the L&F in the starting of my prog. Please help me solve this problem. Also is there any tutorials out there that explain (w/ examples) how to use property files?

I would really apprecite any help that I can get.

Thank you
0
Comment
Question by:seastallon
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
yerkan earned 25 total points
ID: 6206874
Hi,

Did you use any special layout manager? Like GridBagLayout?

Regards,

    Yagiz
    http://www.erkans.com
0
 
LVL 3

Expert Comment

by:yerkan
ID: 6206876
Hi,

Did you use any special layout manager? Like GridBagLayout?

Regards,

    Yagiz
    http://www.erkans.com
0
 
LVL 7

Assisted Solution

by:Sasha_Mapa
Sasha_Mapa earned 25 total points
ID: 6207083
You are using an older version of Swing (probably 1.1.1) on the Unix box. On Windows you were using the new one that comes with JDK1.2 or JDK1.3. If you take the swingall.jar file you are using on unix and use it on windows, you will see the same buttons as on unix.

To use the swingall.jar on windows JDK1.2+ use (for example):

java -Xbootclasspath/p:swingall.jar Application

The example assumes swingall.jar is in the current directory and the name of your main class is Application.

Anyway, if you don't assume any actual sizes but rely on the prederred sizes of the components, you should be fine.

Sasha Maryanovsky.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9010006
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[split points between yerkan ans Sasha_Mapa]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
unix in java example 9 53
windows explorer path to command prompt 5 32
even odd program using while loop 3 28
java stored proc example 9 21
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now