Skip to content
Advertisement

Tag: jframe

Making a JFrame with a JMenuBar open in fullscreen

I have a JFrame that I want to add a menu bar to and then have that JFrame automatically open in fullscreen. If I just make a JFrame and set it to fullscreen with f.setExtendedState(f.getExtendedState()|JFrame.MAXIMIZED_BOTH ); that works fine: However, once I add a JMenuBar to that JFrame it will no longer open in fullscreen: What could be the cause

JFrame Image Update on click of image

tldr; How do you use a MouseEvent on a JFrame object(specifically JLabel) to update the displayed image in the JFrame I am trying to create a program where an image is broken into tiles and on click of one of those tiles, the program moves the tile to the open space in the image. (See Sliding Puzzle for more information).

How to draw polyline with negative coordinates in java [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I want to draw polyline with positive and negative coordinates. e.g. 125,66 126,62 -128,59 -127,55 -125,51 -124,47 -122,43 -121,40 -119,38 -118,36 These are the sample

How I can make my program generate a new random number?

So I tried closing the window and reopening it afterwards so the whole program would start from the beginning. That didn’t work. Neither does Revalidating the frame (f.revalidate(), f.repaint()).. I’ve tried looping the if-functions with a while loop, setting the boolean to false when the number has been guessed. But that just resulted in an endless loop of testing if

How do i write a code to display every letter in every JPanel, and how do I rotate. (JFrame, NetBeans)

I’m new to Java, and I was assigned in my class to develop a code for the following question, I was only able to do the design, after that I didn’t know how to continue adding the actions to every button. This is the question: https://www.chegg.com/homework-help/questions-and-answers/write-java-application-creates-frame-similar-one-shown–four-letter-word-shown-four-panels-q52352988 If anyone has ever solved it, please share it. Thanks for help in advance!

JScrollPane doesn’t show up in JFrame

there. I’m writing a GUI chat client which sends message to the server and receives echoes from the server. The top half of the client JFrame contains a JTextArea wrapped in a JScrollPane which is placed under the menubar. This JScrollPane is responsible for receiving responses from the server which receives messages from a client and broadcast it out to

Advertisement