bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-classpath] [bug #13691] Swing: 2 JCheckBox and 1 AbstractButton bug


From: anonymous
Subject: [bug-classpath] [bug #13691] Swing: 2 JCheckBox and 1 AbstractButton bugs, fixes included
Date: Fri, 8 Jul 2005 14:11:53 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13691>

                 Summary: Swing: 2 JCheckBox and 1 AbstractButton bugs, fixes
included
                 Project: classpath
            Submitted by: None
            Submitted on: Fre 08.07.2005 um 14:11
                Category: None
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:

first bug, if JCheckBox is the source of a ActionEvent and we call a
e.getSource(), the output isnt the same than with the official sun VM.

bugfix:

change in javax.swing.JCheckBox the fonction paramString() to the following
one:

protected  String paramString()
  {
    return super.paramString();
  }

second bug:
if JCheckBox is the source of a ActionEvent and we call a
e.getActionCommand(), we dont get the name of the button.

bugfix:
add setActionCommand(text); to the init() fonction of the JCheckbox. It
willlokk like this:

private void init()
  {
    setActionCommand(text);
    borderPainted = false;
    contentAreaFilled = false;
  }

Third bug. If a button has no text and we get its actionCommand, we get null.
But the sun vm gives us "". So i have two fixes, i dont know which one is more
correct, probably the second one has less risks to disturb other things.

bugfix(version1):
add this "if" in the init fonction of javax.swing.AbstractButton:

if(text == null)
   text = "";

This will set the text displayed in the button to "" if there is no text
set.

bugfix(version2):
an alternative is to add this "if" to the fonction setActionCommand(String
aCommand) of javax.swing.AbstractButton

if(aCommand == null)
   aCommand = "";






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13691>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]