81,304 questions
0
votes
0
answers
65
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 ...
0
votes
2
answers
137
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
151
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
124
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
2
answers
131
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
85
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
143
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
35
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
40
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 ...
0
votes
0
answers
38
views
JMenuItem rendering offset with 1.8.0_481 [duplicate]
After updating from 1.8.0_291 to 1.8.481 I noticed that JMenuItems are now rendered with a big offset on the left side, when using the Windows LAF (did not test on other platforms so far). In some ...
1
vote
1
answer
146
views
CardLayout calculates wrong minimum size
CardLayout for some reason calculates the minimum width regardless of which component is showing. See java.awt.CardLayout#minimumLayoutSize.
Steps to reproduce:
Maximize the window.
Switch the left ...
Tooling
0
votes
4
replies
71
views
Redirect all user interactions from one component to another
I need to interact with one JComponent through another as if I interacted directly with target. This would enable interaction with scaled image of components which would be cheaper to rescale than ...
3
votes
1
answer
161
views
Why does going back and foward with audio clips just stop them working?
So I am trying to make an audio player just because I want to understand stacks and GUIs in java better, I was expecting when a audio file was chosen it should have played which it did before but it ...
-3
votes
1
answer
113
views
javax.swing does not exist [closed]
I'm doing a java OOP assignment and ran across a syntax error that shows JOptionPane does not exist on the import statement. How to fix that?
1
vote
2
answers
140
views
Trying to get explosion to disappear after laser intersects with rectangle object
I am trying to make a little game in Java, where a Spaceship shoots a laser at a rectangle and the rectangle is removed and an explosion .png appears. The problem I am having is trying to make the ...