Article View: borland.public.jbuilder.java.swing
Article #11737Re: Swing questions
From: Jason Burton
Date: Mon, 26 Apr 1999 00:00
Date: Mon, 26 Apr 1999 00:00
28 lines
2091 bytes
2091 bytes
> 1. I can set the property Border of a JButton to None at design time and
> the border disappears. JBuilder Adds a line JButton1.SetBorder(null).
> However I can't set it back at design time with a border. I can remove
> the line JButton1.SetBorder(null) in the source pane and the border will
> reappear. Am I missing something here.
Nope, you're right. The object inspector looks for all instances of a
Border class when listing the available borders for your button. Typically,
there are no border instances created, so the only option is "none." If you
want a different border, you'll either have to add some Border classes to
your component pallete and drop borders onto a form, or set custom borders
in code.
> 2. When I set the property of TooltipText of JButton1, it works fine
> when the mouse is over it. When I reset the property of the ToolTipText
> to nothing , JBuilder still leave the following line in the source code
> jButton1.setToolTipText(""). This causes a small rectangle to appear
> everytime the mouse is over JButton1 which isn't the right behaviour,
> anybody runs into the same problem?.
I couldn't imagine using Swing components directly. I would subclass the
button to eliminate this behavior. The problem really seems like some sort
of IDE limitation. To get rid of the setToolTipText("") line, you would
have to get the IDE to recognize the "default" property value (like Delphi),
and leave out the setXXX method when the property value equals the default
value.
Jason Burton
Technical Details
Message-ID:
<7g1u2r$gi57@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3722B4FC.77BA7A91@ns.sympatico.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,3231f100451f603 X-Google-Attributes: gid111d45,public From: "Jason Burton" <Jason.Burton@McLeodSoftware.com> Subject: Re: Swing questions Date: 1999/04/26 Message-ID: <7g1u2r$gi57@forums.borland.com> X-Deja-AN: 471059508 References: <3722B4FC.77BA7A91@ns.sympatico.ca> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing