Questions tagged [jpanel]

JPanel is a container in the Java Swing Framework that allows custom rendering using layout managers. JPanels can be nested for flexibility. There is also a jQuery plugin with the same name that provides accordions, tabs, and fieldsets from simple container mark up.

JPanel is a container in the Java Swing Framework that allows custom rendering using layout managers. JPanels can be nested for flexibility. There is also a jQuery plugin with the same name that provides accordions, tabs, and fieldsets from simple container mark up.

Resources:

7557 questions
1
vote
2 answers

Change Font type and size for the whole JFrame?

I am working on Java GUI project. I have several components on the swing-based GUI. I want to change the font settings for all the components, rather than changing font for each component one by one. Is there a way to change the font type and size…
Ankit
  • 6,772
  • 11
  • 48
  • 84
1
vote
1 answer

java Swing -- JPanel and PropertyChangeListener

My use case is that a List is passed to a Jpanel and for each String in the List, the JPanel renders a UI component. This UI component consists of 3 buttons and my current code for my given use case is as follows. -- The code for the 'UI…
ping
  • 1,229
  • 3
  • 21
  • 41
1
vote
1 answer

Change location JLabel on JPanel repaint

I'm building a Java application. GameView has a BoardView which contains multiple PawnViews (in the example just one). Example: public class GameView extends Frame { public GameView() { …
Hans Leautaud
  • 1,742
  • 1
  • 19
  • 34
1
vote
2 answers

CardLayout issue

I have a card layout, first card is a menu. I Select the second card, and carry out some action. We'll say add a JTextField by clicking a button. If I return to the menu card, and then go back to the second card, that JTextField I added the first…
Peddler
  • 6,045
  • 4
  • 18
  • 22
1
vote
1 answer

Drawing from multiple classes to the main class in Java

I'm attempting to create a simple game but I'm running into trouble when drawing from multiple classes in the main class. Here is my code so far. public static void main(String[] args) { JFrame mainGameFrame = new JFrame("Space4X"); …
1
vote
0 answers

Calling a JPanel inside a split panel Java

Hi I'm having trouble in my code. I can't call or display my JPanel(TruthTable) inside my splitpane in the Minimize class when I click the button and Keypressed(Enter).The problem is in the class Minimize *UPDATE: I'have solved my problem regarding…
Alvin Pulido
  • 49
  • 2
  • 10
1
vote
1 answer

JFrame reloads initial content on mouse over

I have a JPanel with a GridLayout(1,0) set to a JFrame Borderlayout.SOUTH, there are placed a couple of buttons in here (when pressed they change a variables value to the index of the created button). Everything is added correctly, but when I try…
Petr Safar
  • 107
  • 2
  • 11
1
vote
1 answer

JScrollPane - multiple Images on new line

I currently have a JScrollPane in a JPanel. I have Images that are loaded into the JPanel from a database so the amount of Images that load varies. I have set the JFrame that the JScrollPane is found on to a size of 800 * 800. Atm the pictures from…
user1060187
  • 957
  • 5
  • 12
  • 28
1
vote
4 answers

JScrollPane add to frame issue

I currently have multiple jpanels on a jframe. I can add all of the jpanels fine to the jframe but when I try and add a jscrollpane, nothing shows up. Essentially I just want a jscrollbar/pane on the jframe so that I can scroll down as the size of…
user1060187
  • 957
  • 5
  • 12
  • 28
1
vote
2 answers

Adding to JPanel in application

When a particular button is clicked I want another set of buttons to be added to the Panel, however at the moment when I do this, I can add them as many times as I want, I need this to be only possible once. Would the best way to do this be set the…
Peddler
  • 6,045
  • 4
  • 18
  • 22
1
vote
0 answers

Edit on focus JPanel inside JTable

this question is similar to: Problem getting focus when use JPanel as JTable cell editor Only I seem to be stuck one step back. I have a custom TableCellEditor that returns a JPanel with a JTextField inside (simplified case). I want the JTextField…
poet
  • 111
  • 1
  • 1
  • 7
1
vote
0 answers

I want to set jpanel size which is called in jtree

Here is the piece of code which i'm using to call jpanel JFrame frame = new JFrame(); JSplitPane sppane= new JSplitPane(); JTree tree = new JTree (); Dimension screenSize =…
Mahendra
  • 51
  • 2
  • 7
1
vote
0 answers

Wrong Mouselistener fires

I made a program in Java in which you can draw Ellipses and Rectangles, then later group them to do Resizes and Move actions on them. I add MouseListeners to both the DrawPanel(JPanel) as all the created Shapes(Components on that drawPanel). But…
Sjaak van der Heide
  • 566
  • 2
  • 6
  • 21
1
vote
0 answers

Creating a dynamic frame/ Adding a panel to a frame during runtime

I'm very much a rookie to java and I am trying to make a GUI client which once a button is pressed, then a new panel will be added to the frame. In this instance, when the a button called createMessage is pressed then the following panel will be…
Jono_2007
  • 1,016
  • 3
  • 12
  • 23
1
vote
2 answers

java issue adding / removing panel onclick

Good day, I have created multiple panels and the first one is showing. I need the panel to be removed and a new one added when the user clicks a next icon. In the code below, the panel reference is not recognized in the action listener. How can I…
Chris Shaw
  • 23
  • 4