All Questions
Tagged with visibility swing
74
questions
0
votes
2
answers
63
views
Component not visible after using "setVisible(true)" on it and its parent
I've got a Java 8 app with a couple of JTextFields and a JButton to log into a database and a JTextArea inside a JScrollPane to display errors. Both the textarea and the scrollpane have to be hidden (...
0
votes
0
answers
38
views
Adding JPanel on another JPanel on button press
I have created a MainPanel in which I make a bird fly. To this panel, I have to add a PausePanel panel at the press of a button. If I only use pausePanel.setVisible (true / false) when pressing the ...
0
votes
1
answer
445
views
Changing the visibilty of a label
i'm new to Java and experience a little bit with the WindowBuilder. I want to change the visibility of a different components like labels or textfields. So I wrote an example code: the function is, ...
0
votes
1
answer
81
views
JButton Only Works When Visibility is Set to True-Java
I am trying to make a simple checkers game basically, and I need the user to only be able to see the tiles and the pieces, not the button. When I set the visibility to True, the program works by ...
0
votes
1
answer
373
views
JPanel inside JFrame doesn't show content sometimes. Why?
I managed to fix it but I don't understand why the same code results in different results. Some classmates have had the same problem.
The issue is that it I use miVentana.setVisible(true); before ...
0
votes
2
answers
475
views
How can I set visible to hide the jDialog (inside if condition) that is set visible shown (outside if loop)?
Here I want to open a DialogFrame containing an error message when a buttonGroup is not active & the search button is clicked. So inside the ActionEvent I have made the DialogFrame to setVisible(...
0
votes
1
answer
67
views
Getting the isSelected value of a selected radiobutton in separate class
I realise this is probably the definition of a noob question but I'm pretty stuck and would greatly appreciate any help.
I have an actionlistener and JRadioButton which is declared in the ...
1
vote
1
answer
54
views
JTextArea not visible
Here is my code. I have tried to keep it very simple.
public class GUI_ADV extends JFrame {
public static void main(String[] args) {
NewClass abc = new NewClass();
abc.setLayout(...
-1
votes
1
answer
103
views
Component array returned by getComponents() method can be changed
I'm trying to set a pressed button invisible and set the rest visible. I used getComponents() method to get the three buttons and change its visibility state but something goes wrong.
@Override
...
-1
votes
2
answers
440
views
jLabel won't show
I am slightly confused, I have a jFrame of which I have made in Netbeans. This jFrame has a jLabel, of which is set to setVisible(false); from the beginning. Whenever a specific method is called, I ...
-2
votes
2
answers
173
views
How to set a GUI non-visible within the constructor?
I have a swing GUI class Foo and in the constructor of Foo class, I load some values from the databases. Based on the returning values from database, I can say whether this GUI should be visible or ...
0
votes
0
answers
169
views
JList is hiding the selected element
I have a JList that is built off of a DefaultListModel. I also have a ListSelectionListener added onto the list. I don't know why, but whenever I select an item on the list, it correctly chooses it ...
2
votes
1
answer
1k
views
What determines component visibility in Java?
I'm writing a Java GUI program that uses a JFrame object and several JPanel objects. The JPanel objects use the paint() and repaint() methods, and some of the JPanel ojbects have JLabels and JButtons. ...
0
votes
1
answer
177
views
JButton size is set to default size when visibility is changed
Like I said the JButton GR is set to the default size (size of window) when I click JButton MN.
When the program is started the JButton GR has the right size (200 by 20), when clicked the menu button ...
0
votes
0
answers
33
views
Java Swing - Elements not showing up until mouse hovers over it [duplicate]
I'm currently in the process of programming a Calculator. I have a JFrame, with a JPanel that has all the various elements on it (JButtons, TextArea). However, when the program first starts running, ...