Thanks, Janak. Perhaps in the meantime, you could adjust the doc to say it doesn't work an offer the known workarounds.
-Stuart
-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: [email protected]
Sent: Fri, 18 Aug 2006 1.13PM
Subject: RE: [ULC-developer] ULCComboBox getPreferredSize/setMaximumSize
Hi Stuart, An ULC component's preferredSize is not initialised with its client side default preferredSize as defined by the current LnF. As Etienne pointed out, you will have to use fillers or write an extension. I have created an issue: https://www.canoo.com/jira/browse/UBA-6990. We will discuss it and consider it for a future release. Thanks and regards, Janak >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of Stuart Booth >Sent: Wednesday, August 16, 2006 7:37 AM >To: [email protected] >Subject: [ULC-developer] ULCComboBox getPreferredSize/setMaximumSize > > >Converting a program from Swing to ULC, I notice a change of >behavior, which >I hope you can give me some advise on. > >I have included below a class that demonstrates the problem, followed by a >Swing class that is working as expected. Basically, the combobox in the >toolbar is being extended to the end. This happens by default in >Swing, but >there a simple setMaximumSize of the preferred size sets the width to a >reasonable size. In ULC, this isn't working as it does in Swing. Can you >look at this, please, and offer any suggestions on how I might rework this >to get it working like Swing? > >Thanks! >-Stuart Booth (Abacus Research) > >public class BugsFrameApp extends AbstractApplication { > > public void start() { > new BugsFrame().setVisible(true); > } > > public static void main(String[] args) { > > DevelopmentRunner.setApplicationClass(BugsFrameApp.class); > DevelopmentRunner.run(); > } > > class BugsFrame extends ULCFrame { > > public BugsFrame() { > super("Bugs"); > setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE); > setSize(800, 900); > addComponents(); > } > > private void addComponents() { > ULCToolBar toolbar = new ULCToolBar(); > toolbar.add(new ULCButton("A")); > toolbar.add(new ULCButton("B")); > toolbar.addSeparator(); > ULCComboBox combo = new ULCComboBox(new >String[]{"Red", "Green", >"Blue"}); > toolbar.add(combo); > combo.setMaximumSize(combo.getPreferredSize()); > > add(toolbar, ULCBorderLayoutPane.NORTH); > } > } >} > >This is the Swing class that works perfectly: > >public class BugsFrameApp extends JFrame { > > public static void main(String[] args) { > new BugsFrameApp().setVisible(true); > } > > public BugsFrameApp() { > super("Bugs"); > setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE); > setSize(800, 900); > addComponents(); > } > > private void addComponents() { > JToolBar toolbar = new JToolBar(); > toolbar.add(new JButton("A")); > toolbar.add(new JButton("B")); > toolbar.addSeparator(); > JComboBox combo = new JComboBox(new String[]{"Red", "Green", >"Blue"}); > toolbar.add(combo); > combo.setMaximumSize(combo.getPreferredSize()); > > add(toolbar, BorderLayout.NORTH); > } >} > >_______________________________________________ >ULC-developer mailing list >[email protected] >http://lists.canoo.com/mailman/listinfo/ulc-developer
