81,256 questions
Tooling
0
votes
12
replies
223
views
Should I use Java Swing in 2026?
I wanted to create a Java application with a graphical interface, however, I'm still undecided on which framework I should use.
My question is: Is Swing a good tool to be utilized here? From all I've ...
Best practices
0
votes
5
replies
110
views
Visibility of JFrames
I have a SWING Application. It contains a JToolbar that can be used to open different JFrames. I want to prevent multiple instances of a JFrame from being created when the button is pressed repeatedly....
Best practices
0
votes
3
replies
101
views
What is the best way to connect Java Swing controllers?
I am learning MVC in Java
I am trying to separate the logic from the JFrame using a controller class.
The problem is that my button does not execute the controller method when clicked.
View:
public ...
5
votes
0
answers
114
views
Java Swing+AWT application in Gnome with Wayland on Arch shows crosshair pointer and takes screenshots
I am experiencing a very peculiar behaviour of a Java Swing application with AWT components. I run Arch Linux with Gnome and Wayland.
The application compiles and starts fine - it looks as expected, ...
4
votes
0
answers
128
views
Accepting Drag'n Drop in Java Swing with native data with flavor "application/x-color"
I've encountered a rather interesting problem. I wanted to extend my color-palette-viewer with the functionality to drag the colors into other applications. For a text editor this is easy, a ...
0
votes
1
answer
169
views
How do I display an ImageIcon from an image file in the high-resolution of today's screens?
I'm trying to read an icon from a .png file and display it at half size, to take advantage of the higher resolution of today's screens. But nothing I'm trying works.
Here's what I've tried:
In the ...
0
votes
0
answers
112
views
I want to rearrange the display of an inventory
This method in the Game class makes the inventory by adding a button for each item in the inventory of the player (and adds the listener for each one, to handle the actions later). Sometimes it has to ...
1
vote
2
answers
169
views
How to modify the HTML when copying a JTable's cells?
I have a very simple JTable, similar to the following minimal, reproducible example
import module java.base;
import module java.desktop;
void main()
{
SwingUtilities
.invokeLater
...
1
vote
1
answer
190
views
Problem with searchable combo box in Java Swing
I have made a searchable combo box for use in a Java Swing program.
Here is how I would like it to work:
When clicked, it opens up the options list and enables typing in the box to let the user ...
0
votes
1
answer
134
views
How to deal with Windows DPI scaling for Images?
The App is a Swing GUI app that display a JTable. Data is loaded from a file. The first column is an image rendered on the fly from the data in the file. This works in general. This is an old app ...
-1
votes
1
answer
161
views
Unable to vertically align a JCheckBox with a JLabel with the grid bag layout Java Swing
I am working on a Swing UI with the grid bag layout, but whenever I use a JCheckBox or even a JRadioButton, it is always misaligned other elements such as JLabels
import java.awt.GridBagConstraints;
...
0
votes
1
answer
91
views
JToggleButtons stretching to fill entire JFrame regardless of setSize
I am trying to create a simple Java Swing application with a custom drawing canvas and a set of JToggleButton controls. However, the buttons are currently stretching to cover the entire window, ...
0
votes
1
answer
156
views
Could I to develop a dynamic popup of a JCombobox editable, that changes the content while the user insert or remove text?
I have some problems to set the popup of my JComboBox in java 17. I'm developing my app with windowsBuilder and I want to the popup is updating while the user insert o remove text, only appearing the ...
0
votes
0
answers
40
views
Switch InputMethod by awt.InputContext fail on linux
I recently have a problem of switching input method in my swing application running on linux, the following is my background:
OS: ubuntu22.04
Desktop: Gnome, X11
InputMethod framework: ibus 1.5.26
...
0
votes
0
answers
43
views
How do I change the color of a JComboBox in InjtelliJ SDK
I'm currently developing a plugin for IntelliJ. Therefore I need a JComboBox like this:
val fileListbox = JComboBox(getItems()).apply {
renderer = FileListCellRenderer
}
And I want the JComboBox ...