Skip to content
Advertisement

Tag: swing

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

Advertisement