setVisible « Component « Java Swing Q&A





1. How do I get a JComponent to resize after calling `setVisible(true)`?    stackoverflow.com

Our application displays a 2D view of our data (mainly maps) and then allows the user to change to a 3D view. The 2D and 3D views are generated by custom ...

2. Java - setVisible(true) has no effect on GUI    stackoverflow.com

I created a GUI (called ParameterUI) with the Netbeans GUI Builder and now I want to create an instance of it and display it. However, using

ParameterUI gui = new ParameterUI();
gui.setVisible(true);
doesn't ...

3. Problem with setVisible(boolean)    stackoverflow.com

I have a JFrame with some component on it. I want that the frame disappears when i click on a special button for example exit button. I wrote this code in exit ...

4. setPopupVisible is canceled if it follows on setvisible true    stackoverflow.com

When I press the button in the program below I want the popup menu from the JComboBox to appear and remain up. However it only does that when on the second ...

5. Why does java swing's setVisible take so long?    stackoverflow.com

I am writing a JPanel that is loading labels in a flowlayout whose information is taken from a database table's column. I don't believe this is relevant though, because loading ...

6. .setVisible(true) immediate repaint    stackoverflow.com

In a short method, I hide a JFrame using setVisible(false). Then I take a screenshot and restore the JFrame with setVisible(true). After made visible again, the window is supposed to show a different ...

7. Java Swing dispose() vs. setVisible(false)    stackoverflow.com

I have a standalone Java application that gets data from a database and displays it in a JTable. When the application starts, the user is prompted for a username/password in ...

8. what exactly does setVisible(true) do?? details plz..    coderanch.com

show() and setVisible( true ) are basically the same command. I think that it is a side effect of what they do that is making the call in your program work... a call to validate() or repaint() may work just as well. ( I would bet on validate(), especially since you are dynamically adding new components... ) I believe both of ...

9. setVisible takes too long to return    coderanch.com

/* * ComboTest.java */ import java.awt.*; import javax.swing.*; public class ComboTest { public ComboTest() { final JFrame f = new JFrame("Combo Test"); f.getContentPane().setLayout(new BorderLayout()); System.out.println("created frame"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); String[] items = new String[20]; System.out.println("created data store"); for (int i = 0; i<20; i++) { items[i] = "item " + (i+1); } System.out.println("populated data store"); final JComboBox box = new JComboBox(new DefaultComboBoxModel(items)); System.out.println("created ...





10. How does setVisible(true) work?    coderanch.com

Hi All, I have a class which can either open a JDialog or a native Windows application via JNI. The determination of which one to open is inside the overridden setVisible method. When I call super.setVisible(true), everything works as it's supposed to, e.g., the parent window and all the windows behind the newly visible JDialog continue to repaint themselves, even though ...

11. Problem calling setVisible(true) ?    coderanch.com

Hi Manish, Thanks for your reply. but I am unable to post the code because of 2550 lines. Yes, I called the setSize method setResizable(false); // set the container for the user inetrface setContentPane(getJFrameContentPane()); // set the size and set the location at the center of the screen screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // set the size //setSize(800,600); setSize(screenSize); // get the dimension ...

12. show() and setVisible(boolean)    coderanch.com

13. delay in setVisible( true )    coderanch.com

I am trying to simulate dice rolling as follows: You Rolled: < 2 seconds pass > You Rolled: 3 < 1 more second passes > You Rolled: 3 + 4 = 7 Instead, the whole line displays at once after 3 seconds. Please tell me what is wrong. container = getContentPane(); ... diceLabel = new JLabel( "You rolled: " ); dieOne ...

14. can't get setVisible(false) to work    java-forums.org

Hi! So I'm fetching strings from a database and consequently display them graphically in the form of JCheckBoxes, when the user clicks on one of these boxes some new boxes appear. Which is the point, but the first batch of boxes won't go away. So atm everything just gets bunched together. And as you continue clicking you end up with 200 ...

15. setVisible(true) does not work    java-forums.org

Hi I create a JProgressBar object and use setVisible(true) method for this object but it doesn't work. i.e. progress bar is not visible at all. Just after this calling {setVisible(true)}, I reterive data from MS-Access database which may take time. That's why it doesn't work. What should I do? My source is attached here... To run this program, you should create ...

16. setVisible does not work    java-forums.org

Well. What i want to archive is to hide jTable component during the click button event. It simple does not hide it! It does not do anything. My guess when i use setVisible false it should hide it but it wont. There is no any example needed. I found this on java as a major bug and it is case by ...





17. [SOLVED] Problem with setVisible(); on LINUX    java-forums.org

Hello, Could anyone please tell me why the following code does not work on LINUX but on WINDOWS and what I could do to make it work? I have tried so many workarounds but nothing really worked out, I cannot get it visible again - at least not properly! Thank you in advance! Java Code: private void formWindowIconified(java.awt.event.WindowEvent evt) { [COLOR="Red"]setVisible(false);[/COLOR] ...