Solved

Component size changes when I move to another L&F

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I remove an object from a 3 51
Running JavaFX on the Raspberry Pi 27 119
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 26
DTD and JAVA versions 1 26
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

679 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