Solved

Component size changes when I move to another L&F

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

690 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