Skip to content
Advertisement

Tag: swing

How to create moveable JPanel using BorderLayout?

I want to create a GUI with a sliding Menu. The menu is one of three JPanels organized onto a JFrame with BorderLayout. The Menu in question is on the west side. How can I make it so that the menu can hold Textfields, JLabels, images etc. while having the ability to slide in and out? Answer This can be

Colored Emojis in Java Swing Labels

I was wondering how to dispaly colored emojis in swing. I have a feeling that the Swing (awt) font engine is unable to do this. I’ve tried using the windows emoji font (Segoe UI Emoji), but sadly it only displays the monochrome variants. Is there any UIManager-Property or Client-Property that I can set in order to get the non-monochrome variant

How can you draw rectangles on a JPanel?

I’m trying to create a program that generates rectangles using a slider. The user should be able to move the slider and rectangles should appear on the JPanel above the slider with random positions. I have tried running the program but I’m still unable to display anything, I move the slider but nothing appears on screen. I have tried coding

Possible to remove Title bar from JFileChooser?

I am trying to display a simple JFileChooser that has no Titlebar. Below is the example code: So essentially I want the Border I set to be the top level Title bar. Example image: So far I have had zero luck achieving this, nor found any others looking for a similar appearance. Appreciate the help! Cheers Answer The JFileChooser is

Why can’t NetBeans & Java find Swing’s contents?

After over a decade, I decided to blow the dust off my university dissertation and get it working again. Oddly, NetBeans can’t seem to find the libraries for javax.swing. Every single thing I imported for javax.swing can no longer be found with “cannot find symbol” for javax.swing.JFrame, javax.swing.JLabel etc. I can’t find where the library would be to import it!

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!

Advertisement