Questions tagged [swing]
Swing is a user-interface toolkit in Java and is shipped with the standard Java SDK. It is contained within the package javax.swing.
swing
40
questions
0
votes
1
answer
42
views
Make RGB java.awt.Color lighter
Can I take a java.awt.Color, turn it into a HSL color, and make it a notch lighter or darker — that is, increase or decrease the L value by, say ten points (obviously, within the 0 to 100 range)?
If ...
0
votes
1
answer
33
views
Wrong JCheckBox painting in pressed state with custom icons
I need a JCheckBox with custom icons
However, once I set custom icons, my check box is painted wrong in the "pressed" state
Specifically, it always displays the selected icon
// snippet 1
...
-1
votes
0
answers
13
views
How to see network calls JMX URL when have a java Swing application as an UI?
I am working on leagcy java backend application which is build on EJB's and running on RMI server using JMX framework. And further, whose UI is built as a java SWING app. I am facing difficulties how ...
1
vote
1
answer
76
views
Java Graphics2D.drawImage() Renders Blurry Image only on Windows 125% Scaling and Only on Java Versions after Java 8
I know that Java 9 fixed issues with screen scaling and resolution that were present with Swing in Java 8. However, I have a situation where the exact same code renders clearly if being run on Java 8 ...
-3
votes
0
answers
44
views
My program initially displays a red panel with a line drawn on it. Adding a line assigning ImageIcon[] type variable stops the initial display [closed]
If I add the line marked ******* BUG? ********** by removing the comment sign, then the initial display of the red panel does not take place. However as I resize the form the red panel with a line ...
0
votes
1
answer
42
views
How to acces a Swing UI component without its variable name?
I wanted to create Buttons by clicking on a Button with following code:
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {...
0
votes
0
answers
36
views
How to read Objects in a PDF file with Apache PdfBox in Java?
I'm developing a pdf reader/editor program in Java using Swing for UI with Apache PdfBox. I want to get the objects and their states in each of the pdf pages. I mean the text, images, shapes as ...
0
votes
0
answers
46
views
I need help making sure my code is thread safe
So I am trying to use SwingWorkers in my application (written in Java) where I collect some data from an API and display it in the app's GUI. Please keep in mind that I am very unsure when it comes to ...
0
votes
2
answers
45
views
Updating callers of PropertyChangeListener in Java + Swing
I'm working with Swing and PropertyChangeListener to manage theme changes in an application. Listeners are notified when the theme property changes in the ThemeManager class. However, I need a ...
0
votes
0
answers
31
views
Java swing scrollpane get all component in horizontally
I am making an e-commerce application. In my dashboard frame I have a search panel one product keeper scroll-panel and one menu panel. I want that all my fetched products can be stored inside product ...
0
votes
0
answers
24
views
How do I configure my WSL to make resizeable work for tkinter or swing?
I tried to make a window in both Java and Python, both Swing and TKinter have a method that blocks resizing but it doesn't work if I'm running in WSL. Is there any way to fix this?
I tried using ...
-1
votes
1
answer
27
views
Resize JPanel with animation
I want to make a panel that, when the mouse enters it, its height increases smoothly and when the mouse leaves it, its height decreases smoothly.
public class Main {
private static final int ...
-2
votes
0
answers
39
views
lines appears below the panel in java swing [closed]
I'm developing a snake and ladder game using Java Swing. I am trying to draw lines (representing snakes and ladders) under JPanel or JLabel components, but I'm encountering issues with setting the Z-...
-1
votes
0
answers
38
views
How to trigger ItemListener by JCheckBox setSelected(false)?
I found this answer which states that ItemListener#itemStateChanged is useful as it is invoked when pragmatically setting the JCheckBox by setSelected(true). However, this doesn't apply for the case ...
-1
votes
1
answer
35
views
How to set image size in JTextPane with HTML and CSS (Java, Swing)?
I want to insert an image (say - a formula compiled from LaTeX) into JTextPane, using HTML+CSS for text markup, manually setting it's size. I tried like here
import java.awt.Dimension;
import javax....