Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Java: MacOSX-LF behaving strangely

Java: MacOSX-LF behaving strangely
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2001
Status: Offline
Reply With Quote
Dec 14, 2001, 05:25 AM
 
Hi!

The MacOsX-LF in Java is behaving strangely... I have an app that includes a JTree. I add a custom cell renderer to display custom leaf nodes. These custom components are complex JPanels (code below).

Now, when I run the app with metal-LF, the leaf nodes get painted correctly. When I run it with MacOsX-LF, the leaf node's height gets computed incorrectly (way too narrow), and the components within the leaf node get painted on top of each other.

Does anybody have a suggestion of what I could do?

Greetings,
Dunk
-----------------

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
public class FDInfoPanel extends JPanel {

private JLabel titleLabel;
private JPanel panel1 = new JPanel(new BorderLayout());
private JPanel panel2 = new JPanel(new BorderLayout());
private JLabel label1;
private JLabel label2;
private JComboBox box1;
private JComboBox box2;

public FDInfoPanel(String title, String labString1, String labString2,
String[] objList, int goal1, int goal2) {
titleLabel = new JLabel(title);
label1 = new JLabel(labString1);
label2 = new JLabel(labString2);
box1 = new JComboBox(objList);
box2 = new JComboBox(objList);
this.setLayout(new BorderLayout());
panel1.add(label1, BorderLayout.WEST);
panel1.add(box1, BorderLayout.EAST);
panel2.add(label2,BorderLayout.WEST);
panel2.add(box2, BorderLayout.EAST);
this.add(titleLabel, BorderLayout.NORTH);
this.add(panel1, BorderLayout.CENTER);
this.add(panel2, BorderLayout.SOUTH);
}
...
}
</font>[/code]
Bland alla möbler i ett hus
förtjänar Sängen mest att prisas!
Här sover drinkarn bort sitt rus,
här älskarns heta plågor lisas.

E.J. Stagnelius
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:04 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2