Java Swing set “actual” Frame size (inside)?

I have a JFrame which contains just one JPanel. I have tried setting the Panel's size and packing the frame, but tha...

Draw varying size rectangle with different orientation using rectangle 2D?

I want to draw a rectangle in a java application. I have used rectangle2d to draw a rectangle. I need the rectangle ...

expand and collapse icons?

As you can see from the images below the expand and collapse icons are gray, as is the row selection highlight. This...

What does .pack() do??

I am learning about JPanel and GridLayout , this snippet of code will produce a simple JPanel with 6 buttons packa...

What does .pack() do??

I am learning about JPanel and GridLayout , this snippet of code will produce a simple JPanel with 6 buttons packa...

Java: Superimpose/overlay animated gif on other animated gif?

I'm making a small game. It's not an action one, but a puzzle one, so performance is not quite as important. Now, I ...

How to make an image move while listening to a keypress in Java.?

I'm starting to learn java programming and I think it's cool to learn java through game development. I know how to d...

GIF stops animating while gaming mouse is moving?

While I move my gaming mouse inside a javax.swing.JFrame, all animated GIFs (javax.swing.ImageIcon inside a javax.sw...

How can i display a tick mark and some text on a JButton?

How can i display a tick mark like this - and some text on a JButton. ----------------------- | mybutton...

GridLayout of Buttons to Output a Checkerboard?

I am programming in Java and am still rather new. Experimenting with GUI Basics, I decided to make a checkerboard wi...

How to create a “Game Option/Pause Screen” in Swing??

Background: Making a game in Swing. It is simple turn base game. Not a whole lot going on. Because of this I didn't ...

How can I find out which button was clicked??

I've got my buttons working right, and I'm a listener to each button like this: for(int i = 0; i <= 25; ++i) { ...

Java JTable getting the data of the selected row?

Are there any methods that are used to get the data of the selected row? I just want to simply click a specific row ...

Positioning a JPanel in a JFrame at specific position?

I need an help for positioning a JPanel in a specific position into a Jframe. I have a JPanel in a class who extend...