How to maximize JFrame?
-
I want to know how to maximize a JFrame, and I know I can do: setExtendedState(JFrame.MAXIMIZED_BOTH) but the problem with that is that the Maximize button is still there, instead of it being changed to a minimize button like it should be. So basically, how do I simulate a click to the maximize button?
-
Answer:
You can do it in actionPerformed function. public void actionPerformed(ActionEvent e) { if("Maximize".equals(e.getActionCommand(… { maximizeFrame(frame); } } Here "frame" is the name of your JFrame. And remember, to be able to access the frame in this function; declare "JFrame frame;" inside the class and outside any other function.
Austin at Yahoo! Answers Visit the source
Related Q & A:
- How To Find Manual On How To Make Friendship Bracelets?Best solution by Yahoo! Answers
- how to display .pgm image on a JFrame?Best solution by Stack Overflow
- How do I add a background image to my JFrame?Best solution by Stack Overflow
- What is the Command to Minimize Windows and Maximize Windows without using the mouse?Best solution by Yahoo! Answers
- What is the Command to Minimize Windows Maximize Windows switch Windows close Windows without using the mouse?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.