Interesting NetBeans GUI Builder Behavior

I changed the JPanel from yesterday's blog entry to a JTextField, added it to the Palette, dragged it into a JFrame and then discovered that even in design mode the vertical line moves left and right... which is cool but weird!

Above (top left black background) you see a deployed JFrame where the vertical line moves left and right in the JTextField, as expected, based on the code shown yesterday. But even in design mode in the IDE (right part of the screenshot above), the vertical line is ALSO moving left and right, while I'm designing the JFrame. Does that mean that the JFrame is somehow deployed even while I'm designing it?

Comments:

The form editor is obliged to instantiate your components in the design view so you can see what they would actually look like (at least under some conditions); any animation is just part of that. If that is undesirable, the component should check java.beans.Beans.isDesignTime().

Posted by Jesse Glick on February 24, 2012 at 04:17 PM PST #

How else that could be? It must be created and it must be painted. If you created round button, you would want to have it round when designing, not only when running.

Posted by guest on February 27, 2012 at 12:24 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today