Tried on Ubuntu 20.04 in case it matters. When multiple JTables are present, but you need to look at only the the last user selected row (or cell) of the last selected JTable, how can you reliably know which one that was? I’ve tried list select listeners and focus listeners, but all fail when you are editing a cell in
Tag: swing
Cannot load a thread that loads chart from JFreeChart until clicked
I think I did everything right. All I want is to load the thread that contains chart after the main thread that loads the components and window is finished. But it didn’t work. Somehow I have to click jPanel1 (the panel that will load the chart) and the chart is loaded. Any help would be appreciated. What I’ve tried: Changing
event when press exit button: JOptionPane.showInputDialog
How can I add a function after clicking on the cancel or exit button? I tried it like this but it doesn’t work for me. It shows me an error that choice is null but it couldn’t be because it is int? is there any other possibility to solve it? Answer When you press the “exit” or “cancel” button, you
JFrame keeps application running even after closing
I have a class with only static methods and one of them opens a JOptionPane error message dialogue using a JFrame object as component. This is the class + method: The ErrorPopup method is used inside a JavaFX controller and other places, called like this: Problem is that the application’s process won’t close when I close the the program from
Java – JTextArea refuses to print strings that are just whitespace [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question I have written a command terminal using Swing components. The snippets of code below
Difference between getscaleinstance and scale? (swing java)
I saw a code that used getScaleInstance(x,x) to declare the scale. On the other hand, I also saw that some people used scale to declare the scale. What is the difference? For example: What is the difference between 1 and 2? Answer I have checked the docs for you and have found that: scale() – is a transformation of the
How to clear a JFrame?
I’m still a noob to Swing classes and I wanted to clear the screen after the user activates a button. I have used the following and it didn’t really do anything. Answer you should use it this way
How to make an app using swing that only uses 1 JFrame?
I am making an app or (something.exe). I want to make a class that will serve as my main frame. That is because I don’t want to create new frame for each class that I will make. I want my class MainMenu to have the Frame of MainFrame where I can put buttons and etc. Answer Make use of Model-view-controller
JPanel not showing in JFrame, but JFrame still changes size
I don’t know what I did, or what went wrong, but a change I made at some point in the last while has made my JPanel completely invisible. The JFrame it’s nested in still changes in size to house it, and I can still toggle the content in the combobox. In my desperation, I tried replacing the content of the
How to create JOptionPane with multiple list selections and extract all the choices?
I am interested in creating a JOptionPane or any interactable pop-up Pane that contains multiple list selections. I also wish to extract the selections the user made. The code below shows an MRE where I generate two different JOptionPanes with list selections and extract the choice from each. Essentially, I am trying to combine the two. What one of them