Solved

Component size changes when I move to another L&F

Posted on 2001-06-19
5
193 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

762 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

21 Experts available now in Live!

Get 1:1 Help Now