All Questions
431
questions
0
votes
0
answers
34
views
Is there a way to permanently bring a component to the top layer in Java Swing?
I have a program which creates a panel containing several text spaces, which contain number values. Over these values, I'd like to create an up arrow button and a down arrow button to increase the ...
0
votes
0
answers
33
views
Custom popup don't always get focus
I try to basically implement my own combobox for Swing, because JComboBox has some behavior that doesn't suit my requirements and what I need to override is private, so...
Anyway, I tried making a ...
1
vote
0
answers
27
views
How to put text using JButtons in the JTextField which has focus? [duplicate]
I've made two JTextField controls named textfield1 and textfield2 in Java. I've also made a number pad using JButton components and added an ActionListener to each of them. Now I want the ...
1
vote
1
answer
39
views
How can I move my caret on the other JTextField
I have this code that create some text fields and I want that my caret changes his position to the other JTextField after pressing ENTER. Is it possible to do this? In the picture, I gave an example ...
0
votes
2
answers
286
views
How to set the focus to an image or a label ?[Java Swing]
Let's say I have several images, each of them in a label, is there a way to set the focus on one of the images or JLabels by clicking at it and do some image processing on the clicked image (blur, ...
0
votes
0
answers
98
views
Why is the focus request not working in this code?
I am trying to stablish the focus in the label "test", but it remains on the item "play".
public class GamePanel extends JPanel {
public GamePanel() {
super();
addItem(&...
0
votes
1
answer
34
views
create dialog from listener
Faced the following situation. I have a list of projects in JCombobox. Changing the line in the combo box causes my itemStateChanged method to be called from the ItemListener interface. And it is ...
0
votes
0
answers
33
views
Correct way to execute a Runnable after focus transfer
I want to transfer focus to a component and execute a Runnable when the component is focused. My problem is that the method Component.requestFocusInWindow don't grant me a direct focus transfer even ...
3
votes
1
answer
123
views
Java application - Space vs Enter for activating buttons on Mac
I'm creating a java swing application. The window has several buttons, and I would like the user to use the tab key to switch between buttons, and then press enter to activate the selected button.
I'...
0
votes
1
answer
254
views
Move jcomponent to back without using JLayeredPane
I have written a DragAndDrop MouseListener.
Component A is a "background" image that is behind Component B. Both are located on a JPanel.
I have made the image draggable. However, I want the ...
0
votes
1
answer
70
views
How can I get mouse focus on Windows PCs when using modal Swing?
I need to drag windows that do not have keyboard focus on Windows 10 computers. Swing functions on my PC deny "mouse focus" on all windows in the same java application; they are locked out ...
1
vote
1
answer
114
views
Detect focuslost with many subcomponents
I want to create an expandable panel (to accomodate several UI elements for specific tasks). The panel can be expanded by user action, and should stay expanded as long as any subcomponent in the panel ...
0
votes
2
answers
139
views
JCheckBox mnemonic without transferring focus
As per title, is it possible to change a JCheckBox selection state using a mnemonic key without transferring the focus to the component?
Current behavior as per GIF.
The wanted behavior would be the ...
1
vote
0
answers
132
views
Java Swing - Show glasspane and consume events without losing previous focus owner
We are trying to show the user a milky JGlassPane to indicate that events are currently not accepted, due to a progress-bar or something else currently being shown. While this would usually ...
0
votes
0
answers
128
views
Is it possible to allow a JFrame to be focused without bringing it to the front every time?
I am trying to keep a certain JFrame on top of only one other JFrame, not all JFrames and JDialogs. Thus, I have jFrame1 and jFrame2. I want jFrame2 to always stay on top of jFrame1 even if I click ...