Skip to main content

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.

0 votes
0 answers
12 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) {...
Jonah's user avatar
  • 1
0 votes
0 answers
14 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 ...
Yusuf İhsan Şimşek's user avatar
0 votes
0 answers
32 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 ...
JosephFC97's user avatar
0 votes
0 answers
23 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 ...
IssaKass's user avatar
0 votes
0 answers
22 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 ...
Raj Bhut's user avatar
0 votes
0 answers
21 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 ...
Breno Lima's user avatar
-1 votes
1 answer
26 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 ...
BaRiBoD's user avatar
-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-...
Brutus's user avatar
  • 159
-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 ...
Saleh Rezq's user avatar
-1 votes
1 answer
34 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....
Andrey Voeyko's user avatar
0 votes
1 answer
33 views

How can I make the tabs in the menu bar with rounded corners and margins in Java/Swing using FlatLaf Theme Editor?

I'm creating a Java application with Swing as the GUI. I'm using FlatLaf themes FlatLightLaf. On the JMenuBar I want to create something like this: VSCode Title Bar But I end up with something like ...
Yusuf İhsan Şimşek's user avatar
-3 votes
0 answers
32 views

Java Swing application getting significantly increasingly slower with each object creation [closed]

So basically my application is a JPanel which I'm adding Jlabels to and the labels are moving around. After adding about 20 labels the app is unusably slow. The labels are set to move 60 times per ...
Jonathan Andersson's user avatar
-1 votes
1 answer
37 views

How to use a TableCellRenderer to display an object in a table in Swing

I'm making a todolist app and I'm displaying all the tasks on a JTable(which only has one row), I also added a RowFilter to the JTable inorder to sort the tasks based on different categories. I ...
Farner3232's user avatar
-1 votes
0 answers
31 views

Adding margin to the panel inside a JScrollPane

I have a panel with a BoxLayout layout and I want this panel to have a scrollbar, so I made a JScrollPane. But when I use JScrollPane, the emptyBorder that I add is not added to my panel JPanel panel =...
BaRiBoD's user avatar
-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 ...
Traqu's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
5425