bug-classpath
[Top][All Lists]
Advanced

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

[Bug swing/23900] JFrame doesn't recognize changes in it's ContentPane


From: abalkiss at redhat dot com
Subject: [Bug swing/23900] JFrame doesn't recognize changes in it's ContentPane
Date: 20 Sep 2005 17:17:41 -0000

------- Additional Comments From abalkiss at redhat dot com  2005-09-20 17:17 
-------
The testcase below shows the same bug and shows that calling setSize on the
JFrame causes the JFrame to be properly updated and laid out (provided at least
one of the dimensions increases due to the setSize call).

Testcase: at first everything shows up.  On the JDK typing a line in the console
hides the button, and then another line brings it back up.  Ours never goes away
(although it does have visible == false).

***TESTCASE***
import java.io.*;
import javax.swing.*;
public class Test
{

  public static void main(String[] args) throws IOException
  {
    JFrame jf = new JFrame("title1");
    BufferedReader console = new BufferedReader(new 
InputStreamReader(System.in));
    jf.setSize(600,600);
    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JButton b = new JButton ("hi");
    jf.setContentPane(b);
    jf.show();
    System.out.println ("but vis: "+b.isVisible());
    console.readLine();
    b.setVisible(false);
    jf.setSize(601,500);
    System.out.println ("but vis: "+b.isVisible());
    console.readLine();
    b.setVisible(true);
    System.out.println ("but vis: "+b.isVisible());
  }
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|abalkiss at redhat dot com  |unassigned at gcc dot gnu
                   |                            |dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23900




reply via email to

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