Category "jframe"

Why does paintComponent get called only on some JPanels?

I'm trying to add a background to different JPanels (henceforth they will be called Window). These Windows are classes I created and make them inherit JPanel. T

Can't close JFrame, from click inside JPanel

I have the following situation: I have a JFrame(GridBagLayout) with 3 JPanels in it (headerPanel, bodyPanel, footerPanel); On the bodyPanel I have a login butto

How do I use the same variable between buttons?

I've created a rock paper scissors game in java, but I don't know how I could use the same variable to work between 3 different buttons (rock, paper scissors).

How to go from one JFrame to another Jframe with a JButton

I have removed all of the code besides the JFrame stuff so it would be easier to see. I want to be able to click a JButton, and that should take me to an existi

Why does my for loop to disable buttons not work, but the same loop works for setting colors in JFrame?

I am programming a TicTacToe game and I want to use a for loop with my JButton components inside them like this: private void clearField(){ for (int i = 0;

The best layout for this image?

I don't know which is the best layout to use for this image, I think maybe grid layout (5*1) may be helpful but I can't add multiple components in one grid layo

Open JFrame from JDialog and it shows on top of JDialog

This is the scenario, My JFrame has a button it will open a JDialog when click it and it is a model dialog. JDialog has another button and i want to open anoth

Reading from a .txt file into a JFrame

I'm stuck trying to figure out how to read from a Java file into a JFrame. I need to make a frame and read in the names of cars and how much they cost. From the

Set PlaceHolder on JPasswordField

I am developing a system with Java (using NetBeans) and, to make it more "professional", I've added some cool functions, such as Placeholders (Yes, I know, it's

Switching between screens in Java swing

I had build big application for my client in Android. The new project is to build the same app for PC in Java. So i have started developing with use of swing.

Drag and Resize undecorated JFrame

Currently, I am using the following code to drag and move my undecordated JFrames. private void initialiseGUI(Component component){ //<editor-fold defau

Java Graphics, Graphics panel and Buttons Panel

I am trying to create a Frame that has a graphics panel on the top portion (through a Layout) and a buttons / labels panel underneath it in the same frame. So