This question already has answers here:
Best way to store data between program runs in java?
(11 answers)
How can I save the state of my program and then load it?
(2 answers)
Closed 5 years ago.
For example, if I had checked a JCheckBox when I opened the program, how would I make the it remember the status of the checkbox so that the next time I open up the JFrame, the box stays checked.
I would also like to extend this question to other swing components like radiobuttons, color chooser, etc.
Attempted solution: The only way I can think of it is possibly making a new file so that the program can update and read the status of it and adjust the swing components when opened. However, this is too inefficient. I read online something about cookies but I am not too sure.
Related
This question already has answers here:
How to disable Button when TextField is empty?
(3 answers)
Closed 3 years ago.
I want to disable the button when the text fields are empty.
I have created two fields with the onKeyReleased property
Sorry i sent it unintentionally.
Something like btn.disableProperty().bind(field.textProperty().isEmpty()) should work.
In the future please add a compilable skeleton and what you have tried so far to your question. That makes it way easier to help.
And welcome to stack overflow!
This question already has answers here:
Disable JButton focus border
(5 answers)
Closed 4 years ago.
i'm new there. My first issue:
When i start my GUI java swing application in Window Builder, first object is always selected
and when i click anything (button or anything) it's show like it's clicked and i don't want it to show. What command for this?
You should use this:
button.setFocusPainted(false);
java, swing, awt, remove focus from all objects
This question already has answers here:
Disable Screenshot of my Swing Window
(5 answers)
Closed 9 years ago.
Can I disable the print screen button, while my application is on? Can we use the print screen button as one of the coded keyboard inputs, and equal it to do nothing?
There's no way to do this without affecting the Operating System settings via registry edits, etc.
A user can always unfocus your application, and press print screen taking a capture of the whole screen otherwise.
This question already has answers here:
Java OCR implementation [closed]
(5 answers)
Closed 9 years ago.
Hey guys is it possible to read text from an image, like how you go to submit a form and it ask you to fill in the text inside image. I want to know if it is possible to read the text inside it. If so, what language?
David Biga
EDIT:
I am not trying to read captcha I was just giving an example of an image with text in it.
It is possible to read text with Optical Character Recognition.
However, CAPTCHAs are designed to thwart this, in order to distinguish humans from computers.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I restart a Java application?
i am working on a java program which takes in bunch of values from the user and returns an answer. i have a "clear" button which makes the application ready to for a new set of input. So what i want is that this button should close the frame currently being viewed(create a window closing event and so on) and then call the main() function to create a new instance of my application. How should i do it? I tried this but it closes everything and the new frame doesn't show up:
WindowEvent wev = new WindowEvent(this, WindowEvent.WINDOW_CLOSING);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(wev);
main(newInstance);
and also what does Toolkit do? suggest some readings for that. Thank you.
as per my comments I don't think this is best practise, but it is possible.
This has already been answered here:
How can I restart a Java application?
I hope this helps,