Questions tagged [jlabel]
A Java Swing component to display a short text string or an image, or both.
jlabel
3,271
questions
-1
votes
0
answers
24
views
What is the purpose of `labelFor` in a view xml in Java Swing [duplicate]
So I am using the Swing UI designer for the first time and while editing JLabel for my JTextField I came by labelFor field.
After clicking the arrow on the side it indeed displayed my currently ...
0
votes
0
answers
27
views
Icon-only JButtons layering the icon of the most recently clicked JButton when clicked [duplicate]
I'm using java swing components to build up a goofy, very simple RPG java app, and I've run into this weird behavior where when I click on a JButton, it duplicates the icon of JButtons I've pressed ...
0
votes
2
answers
54
views
How do I Get JFrame to Display JPanel Text Content Even When Called by Action Event?
I have a simple JFrame dialog, that should display "Please Wait" message while the main program completes other activities (which may take anywhere from 30 seconds to more than 10 minutes):
...
0
votes
1
answer
33
views
Picking multiple random JLabels from a JLabel array
I have an array of 256 JLabels. I'm trying to pick 40 random labels, and assign them a new name.
I've tried using a random int method, but I'm not able to convert that to a JLabel.
I'm newer to java. ...
0
votes
1
answer
36
views
Constantly Update GUI JLabel Text
I currently have a program that is reading in live information from a text file which is constantly being updated, which is in its own separate class "Reciever". For this, I have just made ...
0
votes
0
answers
30
views
How to Remove a Cursor When over a JLabel with an image?
this appears when i hover over with an mouse in a JLabel;
i didn´t find any solution and anyone that had the same problem
behind the JLabel is a JPanel and a JFrame
i´m currently using the java 18 and ...
0
votes
0
answers
28
views
JLabel Updating with the Contents of another Control
This should be ridiculously simple. My code runs through a folder listing and counting files. When I update the file count label, the contents of my files list populates the display of the label. Yet ...
0
votes
0
answers
44
views
How to add good quality image to JFrame?
After inserting a good quality image into the JLabel, the final image quality is less detailed (as if it had a lower resolution).original image JFrame screen after inserting. The difference may not be ...
0
votes
1
answer
70
views
Overlapping JLabels in Tetris
So I'm trying to code Tetris in Java and I'm using JLabels for each piece. I'm using a Runnable timer to have the pieces move down, and then I use if statements with an executor to control when the ...
0
votes
1
answer
38
views
JLabel with the text above the icon and left-aligned
I have a label that is created by a 3'd Party lib.
Now I want to fill the label with a text (variable length) and icon (variable width), where the text is above the icon and both are left-aligned. But ...
1
vote
1
answer
47
views
Why is only one component appearing
I have a JFrame and for some reason only one component is appearing
public JFrame mainMenuFrame = new JFrame();
public JLabel welcomeText1 = new JLabel();
public JLabel welcomeText2 = new ...
0
votes
0
answers
7
views
Making netbeans code a little bit shorter
I am writing a netbeans code and exploring, perchance there is a way to shorten this up where I can call one method to have a mouselistener to every jlabels which changes border color each time mouse ...
0
votes
0
answers
15
views
ContentPanel issue, The content panel is not showing up on the second window when I enter the information
This program takes user input for courses and outputs the best possible course that they should research for their post-secondary options. The issue is basically when I Fill in this information in the ...
0
votes
1
answer
37
views
Updating a value of a Jlabel using setext is resetting the Jframe
Im making a game for class, I made a panel to display certain scores however, when it is updated using the update methods of the class which is just setext("" newscore), it resets the frame ...
0
votes
1
answer
102
views
Add an image with JLabel without loss of quality
so I just started learning Java (have some C++ experience) and I'm having some trouble. I never created a GUI, so I'm experimenting with it right now, while learning Java at the same time. The issue I ...