This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 185541 - UI items show in GUI Builder but missing when running app
Summary: UI items show in GUI Builder but missing when running app
Status: RESOLVED DUPLICATE of bug 82583
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 17:28 UTC by xandrani
Modified: 2011-11-16 16:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xandrani 2010-05-05 17:28:40 UTC
Some buttons and other UI elements are missing when I run my application.

They are showing in the GUI Builder, and indeed previously DID show up when running the application.

I have tried a complete clean and rebuild but this doesn't change anything.  There are no warnings or errors in compilation.

Also it worked yesterday and I haven't changed that much since (I know that's a cliché to say that but very little has changed).

Does anyone have any ideas how I can debug this further?  Where do I need to but debug code in order to find out what is going on?  Can I build with more verbosity also?  Any ideas in regard to investigating this issue further would be much appreciated.

Thanks :)

[SEARCHABLE KEYWORDS: missing, disappeared, UI elements, components, buttons, gui builder, not showing, invisible, hidden]
Comment 1 xandrani 2010-05-05 17:30:03 UTC
I forgot to add that when I click the 'Preview Design' button everything is correctly displayed, but as this is part of the GUI Builder also then maybe that is obvious to everyone... but I just thought I'd add that piece of info in case it helps.
Comment 2 xandrani 2010-05-05 17:52:05 UTC
OK fixed it.

It's the same as bug 82583

i.e. somehow the system has set some attributes as having a height or width as 'preferred'.  On specifying an actual height AND width it works.

This is quite obviously a bug... a preferred height should show in the application if it shows on GUI builder... it can't have two different behaviours ;)
Comment 3 xandrani 2010-05-05 18:06:55 UTC
OK so the bug is more complicated than I thought.

I changed one option menu height from preferred to '26' (the option menu is inside a tabbed pane), and now all the option menu's and buttons in that pane now show, even though all the others are set to 'preferred'... ouch ;)
Comment 4 xandrani 2010-05-05 18:11:56 UTC
OK so the bug is more complicated than I thought.

I changed one option menu height from preferred to '26' (the option menu is inside a tabbed pane), and now all the option menu's and buttons in that pane now show, even though all the others are set to 'preferred'... ouch ;)

[I hope I don't get 500 Internal Server Error when reporting this comment this time... here's an equation: NetBeans = bug^10 ;)]
Comment 5 Tomas Pavek 2010-05-06 11:53:25 UTC
I'm a bit lost about what the problem is and what caused it. Is it the size of the main window that is wrong after running the application, or size of some components?

Easiest way would be if you could attach your project here so we could run it and see. (You can also send it privately if don't want to make it public here.)
Comment 6 xandrani 2010-05-06 19:34:50 UTC
OK let me explain in more detail.

Each component that is invisible (e.g. a button), had a width and / or height of 'preferred', which shows up as -1 in the code.

I've realised this bug is a duplicate and loads of people have had this problem... so it might be worth investigating those too.

A guaranteed way to get the invisible components to show again is to specify their heigh exactly, i.e. to not rely on the buggy 'preferred' option (that is set automatically by the GUI Builder - I didn't set it).

However when I changed a button in a tabbed pane from preferred to have a specified height, all the other buttons in that pane then started showing.  Almost as if all of them were set to 'preferred' then they were all invisible, but if just one of them had their height specified then they all became visible.

I can't explain it more accurately than that.  I have fixed the issue in my code, but the bug in GUI Builder remains.  I'd recommend marking this as a duplicate of one of the other bugs.
Comment 7 Tomas Pavek 2010-05-07 11:48:53 UTC
Marking as duplicate, though I don't know how to reproduce this bug.
But getting rid of "Preferred" in null layout and just using the actual size would most probably fix it as well.

*** This bug has been marked as a duplicate of bug 82583 ***