Solved

Component size changes when I move to another L&F

Posted on 2001-06-19
5
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
null output 3 56
login form jsp example 2 68
What is the use of Forwarding Class in java 1 51
Github api to fetch the number of collaborators in a git repo 1 65
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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 …

739 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