SetVisible()

Hi,
I have a problem with the setVisible() method !
My component is a jTextPane and I use it for displaying error messages, in the bottom of my GUI. This jTextPane is in a GridBagLayout, and I use the setVisible() method when I want to display the jTextPane (containing an error message).
My problem is the following: when I change the flag of my setVisible(), the jTextPane hides or displays, but in the same time, the other components in my GUI move !!! As if setVisible(false) was removing the JtextPane instead of hiding it ! Is it normal ?
I've tried another way : putting the JtextPane in a jPanel in order that when the JtextPane hides, the jPanel stays for keeping the dimensions of the GUI and the position of the other components. This way is wrong too and when the JtextPane hides, the components move as before.
The only way I have found is displaying my message text all the time and setting it blank when there is no error message to display, so the components never move, but I don't think it's the right way.
Does somebody know how to use setVisible() correctly ?
Thanks a lot
Lio

GridBagLayout adjusts any surface whenever anything is resized, removed, hidden ... (you get the idea).
That is a planned reaction, because components should be able to react to growing or shrinking windows. If you don't want to use null Layout you have to fix the surface of your window with the gridbag contraints or the sizes of the displayed objects.
The easierst solution for your problem will be to set the minimum and the preferred size of your JPanel where the JTextPane is in.
Rommie.

Similar Messages

  • How can I stop a JFrame from painting it's background on setVisible?

    When a JFrame is set visible it will paint its background before it paints whatever is in the contentPane. This gives an ugly gray flash before the content pane is painted. I can't use the solution of setting the JFrame's background color because the content pane is displaying an image, not a simple color. I need the image to be the first thing displayed when the frame is set visible. Seems related to doublebuffering some how, but I'm not sure what to do. The same problem presents itself with a JWindow IF it has a parent JFrame. Below is code that will demonstrate this problem.
    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class Test extends JFrame{
    JPanel panel = new JPanel();
    public static void main(String[] args) {
    new Test().setVisible(true);
    private Test(){      
    getContentPane().add(panel);
    // setBackground(Color.white); // <-- uncomment this to remove flash.
    panel.setBackground(Color.white);
    setSize(640, 480);
    super.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    I can't use the solution of setting the JFrame's background color because the content pane is displaying an image, not a simple colorMy question to you is what difference does it make?. Like it or not, JFrame is either going to set the background with the LAF control color or the color you specified. Take a look at the source code and you will see that JFrame calls a protected frameinit method where it gets and sets the backgroud color. The only feasible solution is shown below:
    import java.awt.Color;
    import javax.swing.*;
    public class Test extends JFrame {
       JPanel panel = new JPanel();
       public static void main(String[] args) {
          UIManager.put("control",Color.white);  // added by V.V.
          new Test().setVisible(true);
       private Test() {
          getContentPane().add(panel);
          panel.setBackground(Color.white);
          setSize(640, 480);
          super.setDefaultCloseOperation(EXIT_ON_CLOSE);
    };o)
    V.V.

  • I have a problem with setVisible(true) !!!!!!

    Hi!
    Could you tell me please, how can I use the method
    getSize() before call the method setVisible(true)??
    If I call the method getSize() before setVisible(true)
    then return getSize() only 0 !!!!!
    I must call getSize() before setVisible(true).
    Thank you for your help ;-))
    Code:
    import java.awt.*;
    class Test extends Frame
    Test()
    t.setSize(200, 100);
    Button b=new Button("test");
    t.add(b);
    System.out.println("Size: "+ b.getSize()); //It doesn't work!!!!
    t.setVisible(true); // ohne das haut's ihn raus !
    public static void main(String args[])
    (new Test());
    }

    If you want to get the Button size, then you should set the button size before you called getSize(), otherwise you will get the value of zero just like yours.
    Try the following code.
    import java.awt.*;
    class Test extends Frame
    Test()
    setSize(200, 100);
    Button b=new Button("test");
    b.setSize(70,25);
    add(b);
    System.out.println("Size: "+ b.getSize()); //It doesn't work!!!!
    setVisible(true); // ohne das haut's ihn raus !
    public static void main(String args[])
    new Test();
    In this way, you will get the button size!

  • Problem with setVisible(false)

    I everybody!!
    I have a some panels in a JFrame, disposed ones underneath the others. But when I make one of the bottom invisble doing:
    jPanel.setVisible(false);
    the ones in the top becomes down!!
    Is there any way to avoid this?
    Thanks in advance

    If you have multiple panels sharing the same area in a JFrame then you should be using a [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]Card Layout.
    Or you need to remove the old panel before adding the new panel.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Problem with setVisible

    Hi
    I made a class like this.
    class MonthComboBox extends JComboBox
    public MonthComboBox()
    addItem(" ");
    addItem("Jan");
    addItem("Feb");
    addItem("Mar");
    addItem("Apr");
    addItem("May");
    addItem("Jun");
    addItem("Jul");
    addItem("Aug");
    addItem("Sep");
    addItem("Oct");
    addItem("Nov");
    addItem("Dec");
    Now when I tried to do <object>.setVisible(false) in an event handler
    the runtime environment started giving lots of exceptions. Can somebody tell me whats wrong and how to correct this?

    Here is a simple program to hide the combobox, hope it helps.
    If this does not help, then -as already suggested- you have to provide us a little bit more information about your code and exceptions. =)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class MonthComboBox extends JComboBox implements ActionListener
         public MonthComboBox()
              addItem(" ");
              addItem("Jan");
              addItem("Feb");
              addItem("Mar");
              addItem("Apr");
              addItem("May");
              addItem("Jun");
              addItem("Jul");
              addItem("Aug");
              addItem("Sep");
              addItem("Oct");
              addItem("Nov");
              addItem("Dec");
         public void actionPerformed(ActionEvent e)
         if(isVisible())
         setVisible(false);
    else
         setVisible(true);
         public static void main(String [] args)
              //Make JPanel for the combobox
              JPanel mainPanel = new JPanel();
              mainPanel.setLayout(new BorderLayout());
              final MonthComboBox combo = new MonthComboBox();
              mainPanel.add(combo,BorderLayout.WEST);
              //Button that hides the combobox
              JButton button = new JButton("Toggle ComboBox Visibility");
              //Add an actionlistener for the button
              //in this case the combobox itself listens to it's own actions
              button.addActionListener(combo);
         mainPanel.add(button,BorderLayout.EAST);
              //Create a frame to test the code
              JFrame frame = new JFrame("Testing");
              frame.getContentPane().add(mainPanel);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setSize(300,70);
              frame.setVisible(true);
    Br,
    J

  • NullPointerException caused by JFrame.setVisible()

    I'm trying to make a status bar class for use with an app. The code for this class is below. Upon testing the thing i come upon the following exception:
    Exception in thread "main" java.lang.NullPointerException
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WPanelPeer.restack(Unknown Source)
         at sun.awt.windows.WWindowPeer.restack(Unknown Source)
         at java.awt.Container.addNotify(Unknown Source)
         at java.awt.Window.addNotify(Unknown Source)
         at java.awt.Frame.addNotify(Unknown Source)
         at java.awt.Window.show(Unknown Source)
         at java.awt.Component.show(Unknown Source)
         at java.awt.Component.setVisible(Unknown Source)
         at java.awt.Window.setVisible(Unknown Source)
         at org.bio.sigve.gui.JStatusBar.main(JStatusBar.java:56)I'm at a loss as to why I'm getting this. Line 56 is the line where f.setVisible(true) is called. Here's the class:
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.BevelBorder;
    public class JStatusBar extends JPanel {
         private Component[] columns;
         public JStatusBar(){
              super(new FlowLayout());
              setBorder(new BevelBorder(BevelBorder.LOWERED));
              createJStatusBar(1);
         public JStatusBar(int cols) {
              super(new FlowLayout());
              createJStatusBar(cols);
         private void createJStatusBar(int cols) {
              columns = new JLabel[cols];
              for(int i = 0; i<columns.length;i++) {
                   columns[i] = new JLabel("");
                   JPanel p = new JPanel();
                   p.setBorder(new BevelBorder(BevelBorder.LOWERED));
                   //p.add(columns);
                   add(p);
         public void setComponent(Component c, int index) {
         public Component getComponent(int index) {
              return null;
         public void setText(String text, int index) {
              ((JLabel)columns[index]).setText(text);
         public static void main(String[] args) {
              JFrame f = new JFrame();
              JPanel rot = new JPanel(new BorderLayout());
              f.getContentPane().add(rot);
              JStatusBar status = new JStatusBar();
              rot.add(status);
              status.setText("Hei!", 0);
              f.setVisible(true);

    Because you override JPane's getComponent(int index) method,and don't write it right way.

  • Buttons not  appearing (setVisible used)

    I have four buttons.
    This is what i want:
    1)At the begining run=debug=visible
    next=exit2=not visible
    2)When i click debug run=debug=invisible
    next=exit2=visible
    But it's not doing (2)correctly.
    instead it does debug run=debug=invisible
    next and exit2 do not appear.
    Any idea why?
    Here is the code:
    public class PC extends JApplet
    { public void init()
      { Executionionhandler a=new Executionionhandler();
        run=new JButton("Run");
        run.setEnabled(false);
        run.setMinimumSize(new Dimension(110,40));
        run.setPreferredSize(new Dimension(110,40));
        run.setMaximumSize(new Dimension(110,40));
        run.addActionListener(a);
        Debughandler b=new Debughandler();
        debug=new JButton("Debug");
        debug.setMinimumSize(new Dimension(100,40));
        debug.setPreferredSize(new Dimension(100,40));
        debug.setMaximumSize(new Dimension(100,40));
        debug.addActionListener(b);
        Right2=new JPanel();
        Right2.setBackground(Color.cyan);
        Right2.setMinimumSize(new Dimension(395,40));
        Right2.setPreferredSize(new Dimension(395,40));
        Right2.setMaximumSize(new Dimension(395,40));
        Right2.setLayout(new BoxLayout(Right2,BoxLayout.X_AXIS));
        Right2.add(run);
        Right2.add(debug);
        Nexthandler Ne=new Nexthandler();
        next=new JButton("NEXT");
        next.setVisible(false);
        next.addActionListener(Ne);
        Exithandler2 EX2=new Exithandler2();
        exit2=new JButton("EXIT DEBUG");
        exit2.setVisible(false);
        exit2.addActionListener(EX2);
        Right3=new JPanel();
        Right3.setBackground(Color.cyan);
        Right3.setMinimumSize(new Dimension(210,40));
        Right3.setPreferredSize(new Dimension(210,40));
        Right3.setMaximumSize(new Dimension(210,40));
        Right3.setLayout(new FlowLayout());
        Right3.add(next);
        Right3.add(exit2);
      private class Debughandler implements ActionListener
      { public void actionPerformed(ActionEvent event)
        { next.setVisible(true);
          exit2.setVisible(true);
          run.setVisible(false);
          debug.setVisible(false);
          boolean check2=false;
          for(int i=0;i<MemorySize&& check2==false ;i++)
          { if(MemoryContent.getText().length()>0)
    { start2=i;
    check2=true;
    private class Exithandler2 implements ActionListener
    { public void actionPerformed(ActionEvent event)
    { next.setVisible(false);
    exit2.setVisible(false);
    run.setVisible(true);
    debug.setVisible(true);

    Here they are
    import javax.swing.*;
    //import javax.swing.table.AbstractTableModel;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    //import javax.swing.JTable;
    //import javax.swing.table.TableColumn;
    //import javax.swing.DefaultCellEditor;
    //import javax.swing.table.TableCellRenderer;
    //import javax.swing.table.DefaultTableCellRenderer;
    //import javax.swing.JScrollPane;
    //import javax.swing.JComboBox;
    //import javax.swing.JFrame;
    //import javax.swing.SwingUtilities;
    //import javax.swing.JOptionPane;
    public class PC extends JApplet
    { private int MemorySize=100,km,Limit,copy92,m,start1,start2;
      private boolean Stop=false;
      private JTextField MemoryContent[];
      private JLabel MemoryAddress[],MemoryAdd1,MemoryAdd2,calculator1,calculator2;
      private JPanel Memory1,Memory2,Memory3,Memory,Right,Right1,Right2,
              Right3,mainpane;
      private JScrollPane scrollPane1;
      private JButton load,save,clear,exit,run,debug,next,exit2;
      private File fileName;
      public void init()
      { Executionionhandler a=new Executionionhandler();
        run=new JButton("Run");
        run.setEnabled(false);
        run.setMinimumSize(new Dimension(110,40));
        run.setPreferredSize(new Dimension(110,40));
        run.setMaximumSize(new Dimension(110,40));
        run.addActionListener(a);
        Debughandler b=new Debughandler();
        debug=new JButton("Debug");
        debug.setMinimumSize(new Dimension(100,40));
        debug.setPreferredSize(new Dimension(100,40));
        debug.setMaximumSize(new Dimension(100,40));
        debug.addActionListener(b);
        Right2=new JPanel();
        Right2.setBackground(Color.cyan);
        Right2.setMinimumSize(new Dimension(395,40));
        Right2.setPreferredSize(new Dimension(395,40));
        Right2.setMaximumSize(new Dimension(395,40));
        Right2.setLayout(new BoxLayout(Right2,BoxLayout.X_AXIS));
        Right2.add(run);
        Right2.add(debug);
        Nexthandler Ne=new Nexthandler();
        next=new JButton("NEXT");
        next.setVisible(false);
        next.addActionListener(Ne);
        Exithandler2 EX2=new Exithandler2();
        exit2=new JButton("EXIT DEBUG");
        exit2.setVisible(false);
        exit2.addActionListener(EX2);
        Right3=new JPanel();
        Right3.setBackground(Color.cyan);
        Right3.setMinimumSize(new Dimension(210,40));
        Right3.setPreferredSize(new Dimension(210,40));
        Right3.setMaximumSize(new Dimension(210,40));
        Right3.setLayout(new FlowLayout());
        Right3.add(next);
        Right3.add(exit2);
        private class Debughandler implements ActionListener
      { public void actionPerformed(ActionEvent event)
        { next.setVisible(true);
          exit2.setVisible(true);
          run.setVisible(false);
          debug.setVisible(false);
          boolean check2=false;
          for(int i=0;i<MemorySize&& check2==false ;i++)
          { if(MemoryContent.getText().length()>0)
    { start2=i;
    check2=true;
    private class Exithandler2 implements ActionListener
    { public void actionPerformed(ActionEvent event)
    { next.setVisible(false);
    exit2.setVisible(false);
    run.setVisible(true);
    debug.setVisible(true);

  • In Japanese locale setVisible(true) consumes large memory

    In JAPANESE locale - Swap space/memory usage grows enormously when setVisible(true) method is called.
    Problem :
    We are developing / converting a product in JAVA built with AWT components in JAPANESE locale. While testing our product, we observed that memory usage (Total VSS column in EnglishResult.txt & JapaneseResult.txt) and Swap space used growing continuously using ?GLANCE? tool, and it was found that setVisible(true) (For any component like Frame, Dialog etc.,) method consumes large amount of memory.
    To ensure this problem, the following ?Operation Memory? test was carried out with a sample application in the below mentioned combination of configuration and platforms.
    Java Language : JRE 1.3.1 (Hotspot Client) , JRE 1.2.2 , JRE 1.1.8
    Locale : Japanese (ja , ja_JP.PCK , ja_JP.UTF-8 , ja_JP.EUCJP , Japanese)
    OS          : Solaris 8 ? 256 MB RAM , Swap Space 1 GB
    Operation Memory:
    1.     Execute the application
    2.     Press the ?Show? button
    3.     After a dialog is appeared , press the ?Hide? button
    4.     Repeat the steps 2 & 3 for 3 times.
    5.     Repeat step 4 for 3 times.
    The data is collected at the following points using GLANCE tool and the result is shown in EnglishResult.txt (Data of English Locale), JapaneseResult.txt (Data of Japanese locale).
    1.     After Step 1
    2.     After Step 4 ( 3 times)
    In the attached result it is found that for every 3 times of opening and closing the dialog , there is an increase of 1 MB of swap space used & Total VSS , where as in the original product that we have developed , for every opening and closing of dialog there is an increase of 7MB ,
    We observed the ?memory growing? behavior in all JRE versions and all Japanese locales .How ever we attaching data collected only in JRE 1.3.1, ja_JP.EUCJP, Solaris 8.
    using GLANCE tool.
    1)ResultJapanese.Txt ? Data collected in Japanese locale
    2)ResultEnglish.Txt - Data collected in English Locale
    This behavior is NOT observed if the locale is set to English.
    Kindly suggest us to overcome the above said problem in JAPANESE locale.
    Sample Java Code (Mem.java)
    import java.awt.*;
    import java.awt.event.*;
    public class mem
         public static void main(String arg[])
              showframe sf = new showframe();
              sf.setSize(300,300);
              sf.show();
    class showframe extends Frame implements ActionListener
         Button b1,b2;
         tpframe tpf ;
         showframe()
              tpf = new tpframe();
              b1 = new Button("show");
              b2 = new Button("hide");
              setLayout(new FlowLayout());
              add(b1);     add(b2);
              b1.addActionListener(this);
              b2.addActionListener(this);
         public void actionPerformed(ActionEvent ae)
              if(ae.getSource()==b1)
                   tpf = new tpframe();
                   tpf.setVisible(true);
              if(ae.getSource()==b2)
                   tpf.setVisible(false);
    class tpframe extends Frame
         TextField tx1,tx2,tx3,tx4 ;
         tpframe()
              Panel p1 = new Panel();
              Label lb1 = new Label("first tab panel");
              tx1 = new TextField("ONEONE");
              tx2 = new TextField("ONEONE");
              tx3 = new TextField("ONEONE");
              tx4 = new TextField("ONEONE");
              p1.setLayout(new FlowLayout());
              p1.add(lb1);
    p1.add(tx1);p1.add(tx2);
    p1.add(tx3);p1.add(tx4);
              add(p1,BorderLayout.CENTER);
              setSize(300,300);
    JapaneseResult.txt (Data collected using GLANCE tool in Japanese locale)
    ========================================================================
    B3694A GlancePlus C.03.10.00 04:17:58 nucleus sun4m Current Avg High
    CPU Util S SUU | 16% 22% 60%
    Disk Util | 0% 1% 3%
    Mem Util SSU U | 42% 42% 42%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.8mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 144mb Other VSS: 27mb Total VSS: 37mb
    B3694A GlancePlus C.03.10.00 04:17:58 nucleus sun4m Current Avg High
    CPU Util S SUU | 16% 22% 60%
    Disk Util | 0% 1% 3%
    Mem Util SSU U | 42% 42% 42%
    Swap Util U URR | 12% 11% 12%
    SWAP SPACE Users= 6
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 64mb
    Swap Avail: 738mb Swap Used: 64mb Resvd Util (%): 12 Swap Reserved: 85mb
    *********** after the dialog is shown for the first time ***********
    B3694A GlancePlus C.03.10.00 04:19:22 nucleus sun4m Current Avg High
    CPU Util SSUU | 6% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 42% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 4.0mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 145mb Other VSS: 27mb Total VSS: 38mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 66mb
    Swap Avail: 738mb Swap Used: 66mb Resvd Util (%): 12 Swap Reserved: 88mb
    *********** after opening and closing the dialog 3 times ********
    B3694A GlancePlus C.03.10.00 04:20:25 nucleus sun4m Current Avg High
    CPU Util S SU U | 18% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 42% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 4.9mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 146mb Other VSS: 27mb Total VSS: 39mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 67mb
    Swap Avail: 738mb Swap Used: 67mb Resvd Util (%): 12 Swap Reserved: 89mb
    **************** opening and closing for next 3 times ( total 6 times ) **********
    B3694A GlancePlus C.03.10.00 04:21:26 nucleus sun4m Current Avg High
    CPU Util S SUU | 9% 20% 85%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 43% 43% 43%
    Swap Util U URR | 12% 11% 12%
    Memory Regions PID: 6521, java PPID: 6485 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 5.8mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.5mb 0xe8000000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 147mb Other VSS: 27mb Total VSS: 40mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 67mb
    Swap Avail: 738mb Swap Used: 67mb Resvd Util (%): 12 Swap Reserved: 89mb
    *********** after opening and closing the dialog 3 more times ( total 9 times )********
    EnglishResult.Txt (Data collected using GLANCE Tool in English locale)
    B3694A GlancePlus C.03.10.00 04:01:33 nucleus sun4m Current Avg High
    CPU Util S SUU | 17% 36% 100%
    Disk Util DD | 3% 1% 3%
    Mem Util SSU U | 35% 34% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.0mb 0xe8000000 <shmem>
    SHMEM /S 1 30.0mb 0xe8200000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 35mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    ************* after the dialog was opened for the first time **********
    B3694A GlancePlus C.03.10.00 04:03:39 nucleus sun4m Current Avg High
    CPU Util SSUU | 7% 19% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    ************ after open and close of dialog for 3 times **********
    B3694A GlancePlus C.03.10.00 04:05:38 nucleus sun4m Current Avg High
    CPU Util S SU U | 38% 15% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    *********** after opening and closing the dialog for next 3 times ( total-6 times) **********
    B3694A GlancePlus C.03.10.00 04:07:46 nucleus sun4m Current Avg High
    CPU Util SSU | 5% 13% 100%
    Disk Util | 0% 0% 3%
    Mem Util SSU U | 35% 35% 35%
    Swap Util U URR | 9% 8% 9%
    Memory Regions PID: 6310, java PPID: 6264 User: root
    Type RefCnt VSS VirtAddress File Name
    TEXT /S 4 24kb 0x00010000 <reg,ufs,i...xf67c61e8>
    BSS /S 4 4kb 0x00025000 <reg,ufs,i...xf67c61e8>
    SHMEM /S 1 2.3mb 0x00026000 <shmem>
    SHMEM /S 1 2.1mb 0xe4000000 <shmem>
    SHMEM /S 1 4.9mb 0xe4220000 <shmem>
    SHMEM /S 1 1.4mb 0xe4710000 <shmem>
    SHMEM /S 1 55.6mb 0xe4870000 <shmem>
    SHMEM /S 1 2.2mb 0xe8000000 <shmem>
    SHMEM /S 1 29.7mb 0xe8240000 <shmem>
    SHMEM /S 1 516kb 0xeab40000 <shmem>
    SHMEM /S 1 516kb 0xeac00000 <shmem>
    Text VSS: 24kb Data VSS: 4kb Stack VSS: 512kb
    Shmem VSS: 143mb Other VSS: 26mb Total VSS: 36mb
    Swap Device Type Avail (mb) Used (mb)
    /dev/dsk/c0t3d0s1 device 514mb 0mb
    pseudo-swap memory 224mb 46mb
    Swap Avail: 738mb Swap Used: 46mb Resvd Util (%): 9 Swap Reserved: 67mb
    *********** after open and close of dialog for the next 3 times ( total-9 times ) *********

    I have the same problem!
    Our program chews up memory like there is no tomorrow when opening and closing frames....
    I will try to start a new thread in this forum explaining our problems a bit more in depth. I have a strange feeling that the garbage collector doesn't do it's job as supposed to.

  • Size of left/right component in a JSplitPane after setVisible()

    Hi there,
    Could you help me here,
    I have a JSplitPane containing 2 JPanels, left and right ones. My app. sometimes needs to call setVisible(false) on these when they are not required. Then, if they are needed again, I call setVisible(true) on them, however after this call, the JPanels are of size 0, so you can't actually see them unless you drag the dividor.
    How do I get the size of these JPanels to return to what they were before calling setVisible(false)?

    Hi there,
    Could you help me here,
    I have a JSplitPane containing 2 JPanels, left and right ones. My app. sometimes needs to call setVisible(false) on these when they are not required. Then, if they are needed again, I call setVisible(true) on them, however after this call, the JPanels are of size 0, so you can't actually see them unless you drag the dividor.
    How do I get the size of these JPanels to return to what they were before calling setVisible(false)?

  • A Jrame with progressbar that is setVisible() in a n otherThread

    This title may seem a bit weird, but I really don't know how to explain it.
    My problem is this:
    For a (huge :p) project for school we need to read csv( Comma separated value) and put them in a database. Because this can take a while on remote servers I wanted to make Jframe with progressbar that is updated with each function that is done. But for some reason he doesn't show this Jframe UNTILL everything is read. It's like he doesn't use the Thread at all.
    I have to say I allready have 1 thread running for checking the database connection (+ the threads that swing uses), I don't know if this causes any problems:
    Here's the code
    The thread class
    * CsvCheckDoneThread.java
    * Created on 2 juni 2007, 18:12
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package Data;
    import View.CsvProgress;
    * @author Welles
    public class CsvCheckDoneThread implements Runnable {
        CsvProgress progress=new CsvProgress();
        /** Creates a new instance of CsvCheckDoneThread */
        public CsvCheckDoneThread(){
        public void run() {
            progress.setVisible(true);
        public void stopthread(){
            progress.dispose();
        public void setValue(int value){
            progress.setValue(value);
    }the Jframe with the progressbar
    * CsvProgress.java
    * Created on 2 juni 2007, 18:35
    package View;
    import javax.swing.*;
    import java.awt.*;
    * @author  Welles
    public class CsvProgress extends JFrame {
        /** Creates new form CsvProgress */
        public CsvProgress() {
            initComponents();
            //centerscreen();
            this.prgbar.setValue(0);
        private void centerscreen(){
            Dimension dim = getToolkit().getScreenSize();
            Rectangle abounds = getBounds();
            setLocation((dim.width - abounds.width) / 2,(dim.height - abounds.height) / 2);
        public void setValue(int value){
            this.prgbar.setValue(this.prgbar.getValue()+value);
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            prgbar = new javax.swing.JProgressBar();
            jLabel1 = new javax.swing.JLabel();
            jPanel2 = new javax.swing.JPanel();
            jLabel2 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setAlwaysOnTop(true);
            setBackground(new java.awt.Color(214, 205, 244));
            setResizable(false);
            prgbar.setStringPainted(true);
            jLabel1.setFont(new java.awt.Font("Calibri", 0, 14));
            jLabel1.setForeground(new java.awt.Color(0, 0, 153));
            jLabel1.setText("<html>De csv's worden geladen.<br><p align=\"center\">Even geduld aub</p></html>");
            jPanel2.setBackground(new java.awt.Color(67, 67, 201));
            jLabel2.setFont(new java.awt.Font("Calibri", 0, 48));
            jLabel2.setForeground(new java.awt.Color(255, 255, 255));
            jLabel2.setText("<html>D<br>C<br>I</html>");
            javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(29, 29, 29)
                    .addComponent(jLabel2)
                    .addContainerGap(37, Short.MAX_VALUE))
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(23, Short.MAX_VALUE))
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(27, 27, 27)
                            .addComponent(prgbar, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(80, 80, 80)
                            .addComponent(jLabel1)))
                    .addGap(34, 34, 34))
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(65, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGap(18, 18, 18)
                    .addComponent(prgbar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(77, 77, 77))
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
         * @param args the command line arguments
        // Variables declaration - do not modify                    
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JProgressBar prgbar;
        // End of variables declaration                  
    }The class where I run the Thread
    public void InitializeCsv(String path) throws SQLException, IOException{
            csvcheckclass=new CsvCheckDoneThread();
            Thread cvsth = new Thread(csvcheckclass);
            try{
                cvsth.start();
                Csv c= new Csv(game, wedstrijd, speeldag, speler, team, club, reeks, bc,csvcheckclass);
                c.LeesCsv(path);
                kalender k= new kalender(14,wedstrijd,team, club, bc);
                k.create(); 
                csvcheckclass.stopthread();
            } catch (SQLException e){
                csvcheckclass.stopthread();
                throw new SQLException();
        }Some words will probably be unreadable by you guys (unless you understand dutch/flemisch), but I hope you get the picture on what I like to do :).
    If you could tell me what I'm doing wrong it would be a gigantic help for me (this is the last thing that I need to do).
    grtz!

    The most likely answer is that your CVS code is actually running in the AWTEventQueue thread. The fact that you call setVisible in another thread really does nothing, since it is the AWTEventQueue thread that actually controls the painting of the object. I am really surprised that having it in another thread actually does something different than not. Try printing out the name of the thread from the CSV code and see if I'm right, maybe we can work from there.

  • Application hangs on setVisible call in Solaris 8

    I have a Swing application that I am having trouble with. The swing part of it is simple enough, however it does use a C++ API with JNI. It all works perfectly on Linux. However in Solaris 8 the application hangs on the call to either myFrame.pack () or myFrame.setVisible (true). It simply never returns from either of these functions when called. It doesn't crash.
    I have commented out all of the JNI stuff to eliminate that as a possible cause. Oh and I am using the -d64 option on the JVM because the JNI library is 64 bit.
    Any thoughts?

    First question is - did you get a thread dump?
    On Solaris, if you run the app in a terminal window, then type C-\ (control-backslash) you get a thread dump. What you'll be looking for is multiple threads "waiting for monitor" on the same object.
    - David

  • Need help in the use of 'setVisible()'

    Well i am having some problems using the setVisible() method.
    what i want to do is to have a textfield appear when a button is clicked.
    It have a button and a textfield and i add it in the init() method. i also added a actionlistener to the button and set the textfield with setVisible(false).
    In the action performed method i did a e.getSource to make sure it was the button and i also have a repaint() in the method.
    the problem is the when i click the button, the textfield did not appear. But if i resize the window, it appears.
    Thanks to all who can help.

    Try this instead:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class test extends Applet implements ActionListener{
    private Button testBut,but;
    private TextField testTxt;
    public void init(){
    testBut=new Button ("Test");
    add(testBut);
    testBut.addActionListener(this);
    testTxt=new TextField (5);
    add(testTxt);
    testTxt.setVisible(false);
    public void actionPerformed(ActionEvent e){
    if (e.getSource()==testBut){
    showStatus("help");
    testTxt.setVisible(true);
    //This should force a repaint, if not add setVisible(false)
    //before the setVisible(true)
    setVisible(true);
    public void paint(Graphics g){
    }

  • Getting new sizes immediately after calilng setVisible

    How can I get the new sizes after hiding/showing a panel? I have a left and right panels, and a thin vertical bar in between that will alternatively collapse/expand the left panel whenever a user click on it. There's a PDF document in the right panel and I want it to do a "fit to page" calculation immediately after the left panel hides/shows. If I do it without the invokeLater() method, the sizes after setVisible() doesn't change and then the sizes will always be one click "behind". Like for example, when I first click on the vertical bar, the left panel collapses and the PDF page size stays the same. After the second click on the bar, the left panel expands (right panel gets smaller) and the PDF page gets bigger and fits the previous size of the right panel when the left panel was collapsed. It's like the program is recording the previous sizes, not new ones. I understand that there's an event dispatching thread and the sizes wont be updated until after the layout calculation has been done in the thread. How can I make it to do the layout immediately after calling setVisible()? I can bear with this, but there's a noticeable "fit to page" lag after the left panel changes its visibility. Is there a better way to do this?
    Here's the snippet of the code:
    This is where the visibility changes and where it calls the "fit to page" (fitPdfToViewport) method.
    public void toggleMenuButtonVisibility(){
         final PdfViewerPanel viewPanel = efbFrame.getPdfViewerPanel();
         this.menuContentPanel.setVisible(this.hidden);
         this.hidden = !hidden;
         if(viewPanel.isFitToPage){
    //          viewPanel.validate();
    //          this.menuContentPanel.validate();
              Runnable blah = new Runnable(){
                   public void run(){
                        viewPanel.fitPdfToViewport();
              SwingUtilities.invokeLater(blah);
    }This is the "fit to page" method:
    public void fitPdfToViewport(){
         this.pdfController.setZoom(1.0f);     //reset the PDF dimension
         Dimension viewDim = this.documentPanel.getSize();
         Dimension pdfDim = this.pdfController.getDocumentViewSize();
         if(pdfDim != null && viewDim != null){
              float vRatio = (float)viewDim.height / pdfDim.height;
              float hRatio = (float)viewDim.width / pdfDim.width;
              float ratio = (vRatio > hRatio) ? hRatio : vRatio;
              this.pdfController.setMinumumZoom(ratio);
              this.pdfController.setZoom(ratio);
    }Thanks in advance, guys!

    Add a ComponentListener to your panel containing the PDF. On componentResize() you add your code.

  • Adding more than 1 JPanel on right side of JSplitPane then use setVisible?

    Hi im creating a option dialog in a program in where when they open it, it displays a JSplitPane with a list on the right side and the option screen on the left.
    When someone clicks on one ot the list items the required Panel is displayed on the right.
    I have Some Panels and if i do this.
    OptionsSplitPane.setRightComponent(First Panel);
    OptionsSplitPane.setRightComponent(Second Panel);
    FirstPanel.setVisible(true);
    SecondPanel.setVisible(false);
    it doesnt display either Panel on the right. I assume im overwriting the first panel when i set it again.
    How can i do what i want to do?
    Thanks

    Hi,
    a JSplitPane excepts only 1 component on either side - so, if you want to have more than one component on one side, you should place a JPanel with CardLayout there and place your components inside this panel and switch to the "card" you want to show - see CardLayout.
    Hope, this gives you an idea, how do do that
    greetings Marsian

  • Problem with RenderingAttributes.setVisible()

    I am writing a function to go through a list of primitives (in this case boxes) and make certain boxes visible.
    my code:
         private void draw2(GameCube cube){
              RenderingAttributes ra = new RenderingAttributes();
              for (int x = 0; x < cube.getXSize(); x++) {
                   for (int y = 0; y < cube.getYSize(); y++) {
                        for (int z = 0; z < cube.getZSize(); z++) {     
                             Appearance ap = new Appearance();
                             ap.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_WRITE);
                             ap.setCapability(RenderingAttributes.ALLOW_VISIBLE_WRITE);
                             ap = mBoxes[x][y][z].getAppearance();
                             ra.setVisible(false);
                             ap.setRenderingAttributes(ra);
                             mBoxes[x][y][z].setAppearance(ap);                         
              Appearance ap2 = new Appearance();
              RenderingAttributes ra2 = new RenderingAttributes();
              ra2.setVisible( true );
              ap2 = mBoxes[0][0][0].getAppearance();
              ap2.setRenderingAttributes(ra2);
              mBoxes[0][0][0].setAppearance(ap2);     
         }As you can see I go through all the boxes and make them invisible, and then as a test I make one visible. It works fine when called from the class constructor:
              mScene = new BranchGroup();          
              mViewGroup = createScene(mCube,tempAxis,0);
              draw2(mCube);          
              mScene.addChild(mViewGroup);But when I try to call it from my Key Listener:
         public class MyKeyListener extends KeyAdapter {
              public void keyPressed(KeyEvent ke) {
                   int kc = ke.getKeyCode();
                   if(kc == 37)
                        Axis tempax = new Axis('y');
                        draw2(mCube);
                   }I get the exception "Exception in thread "AWT-EventQueue-0" javax.media.j3d.CapabilityNotSetException: Appearance: no capability to set renderingAttributes" on the line:
    ap.setRenderingAttributes(ra);
    which is weird, since I have just set it to ALLOW_RENDERING_ATTRIBUTES_WRITE
    Any ideas?
    Ed

    Because it is a dynamic toolbar for a vectorial
    editor:
    following the kind of selected shape, the toolbar
    shows or hides buttons. If I remove them to add them
    again few times after, the order of the buttons will
    always changed (that's annoying for users).Is it possibly just as appropriate to disable the buttons until they are again appropriate? I understand that the issue is that the L&F behaves differently from the others, and it shouldn't, but this may offer a temporary workaround.

  • Does JDialog setVisible create a new threaD?

    I am having a problem with my program and it seems that it may be because my call to JDialog setVisible is creating a new thread. In my program I have a JDialog which is a creation wizard that puts some specific files in the specified directory. After this is done I try and zip up the contents and bundle the zip file with some other files. My problem is that if I don't place a dialog after my call JDialog setVisible() then not all the right files will be in the newly created zip. It seems to me this is likely happening because the call to setVisible is creating a new thread and operation is continuing before the wizard is done placing all the right files in the directory. Does this make sense? Does setVisible create its own thread?

    In the future Swing related questions should be posted in the Swing forum.
    No a new thread is not created. setVisible() displays the dialog. If the dialog is modal then statements after the setVisibile are not executed until the dialog is closed. If the dialog is not modal, then the statements execute right away.

Maybe you are looking for

  • To read a Text-File

    I have a huge Text-File. Now I want that the Program reads the Rows until the first Row "EXECUTE" (there are more rows that begins with "Execute") in the Text-File and to write the Rows in another Text-File. I write the Program so that all Rows that

  • Unecessary use of SELECT...FOR UPDATE causing Deadlock

    DB version:10gR2 We are getting a deadlock issue frequently. When i looked at the trace file i found that the <em>Rolled back SQL</em> and the <em>Successfull SQL</em> are both <strong>SELECT FOR UPDATE</strong> statements. They both are declared bef

  • Depreciation run for one asset

    Hi gurus, can we run depreciation only for one asset. I am trying to run depreciation for one asset for testing purpose but system is picking more than one

  • Water damaged iPhone - Ultrasonic cleaning?

    Hi, I have managed to kill my 16GB iPhone G3, it might be smart but unfortunately it can't swim. I have emailed a few repair companies. ipaqrepair.co.uk has offered me free diagnostic and said they can repair some water damaged units using an ultra s

  • How do she change ID and retain Contacts?

    My daughter and I share my Apple ID. We want to give her a new ID on her iPhone 4. How does she create a new ID and still retain her Contacts, Calendar, etc? Then, we would like to have her iCloud stuff and my iCloud stuff on our shared iMac. Can we