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
2
votes
2 answers

JPanel ActionMethod when it is shown

I search for a method, which gets called if the jpanel is shown on the display, because i have to fetch the real size of the panel. Any suggestions?
Christian 'fuzi' Orgler
  • 1,682
  • 8
  • 27
  • 51
2
votes
1 answer

Repaint JPanel doesn't work in JApplet

I have the the main JPanel (in JApplet ) which containts the child JPanel and the button. I want to click the button make the child JPanel removed and another child JPanel added to the main JPanel, but the problem is that only when I reclick the…
TU_HEO DAKAI
  • 2,197
  • 8
  • 28
  • 39
2
votes
1 answer

Empty JPanel not positioning correctly in relation to other JPanels

I am using swing to build a GUI with 4 JPanels inside a JPanel using the BorderLayout manager: A row of labels A column of JButtons A display area (it is a class that extends JPanel and has nothing added to it and is used as a drawing area) Another…
Jonno_FTW
  • 8,601
  • 7
  • 58
  • 90
2
votes
1 answer

Java JPanel animation

So I am writing a game in Java, and I started out using the drawRect() method to represent players, enemies, and shots. Everything was great. Then I decided to try to get fancy. I found myself creating .png images of each object and used the…
user1320716
  • 170
  • 6
2
votes
2 answers

Java GUI (SWING/AWT) - Empty Frame - Components not showing

I'm trying to create (hand-coded) a GUI similair to the GUI shown below, however, only an empty frame shows. Mock GUI: I've used various layouts and SWING/AWT components to create the GUI and 4 JPanels which contain: mainPanel: Contains all the…
Brian
  • 1,951
  • 16
  • 56
  • 101
2
votes
1 answer

JPanel custom paint

I am having an issue painting a JPanel. It paints correctly, however when I resize the parent container, the JPanel gets painted at the top left corner of the window, as well as in the correct position. The JPanel has a custom paint method, that…
Zack Newsham
  • 2,810
  • 1
  • 23
  • 43
1
vote
2 answers

Java Swing interface issue

here's my problems : I tried to create a simple interface from where I can click on several buttons that call differents functions, and show the result (which always is text) in a jlabel.I tried to have 2 separates parts (north/south or east/west)…
WizLiz
  • 2,068
  • 5
  • 25
  • 39
1
vote
1 answer

Issue with JPanel as scrollable

I am developing a java JApplet to display few 10s of check boxes in scrollable pane. I included these check boxes in JPanel and added this panel on JScrollPane which is added in current ContentPane of applet. Content pane also has few other…
1
vote
1 answer

Opening a new panel by just clicking a portion of the panel

I am using Net beans drag and drop GUI and in that i am displaying a chart in a jPanel and i want that when i click a portion of that chart then another panel opens up.I know we can write an event , when we click a whole panel(anywhere in panel)…
Xara
  • 8,748
  • 16
  • 52
  • 82
1
vote
1 answer

Getting X and Y instead of horizontal/vertical size in layout properties of Swing JPanel

When if a panel has layout properties like horizontal size and vertical size, then I'm able to hide the panel and space used by panel is also shrinking. But If the panel has layout properties like X and Y, then I'm able to hide the panel, But…
merlachandra
  • 376
  • 2
  • 17
1
vote
0 answers

Add scroll bar to panel

I created a simple Java program and I add a simple JApplet file to resources and created a JApplet Form. Then I made a simple Java class named Main_Draw_JPanel. I add to pane of applet that one of them is an object of class Main_Draw_JPanel . I…
Mohsen
  • 584
  • 1
  • 5
  • 11
1
vote
1 answer

Java Panel Won't Paint

Basic summary: Working on a game that generates a 15x15 grid for the player to move around in. Each cell in the grid as an image that is randomly generated with shades of brown so each cell looks different. Only problem is I'm trying to create a…
mbreen
  • 558
  • 3
  • 9
  • 20
1
vote
1 answer

JViewport won't generate a viewport for JPanel's derived class

I believe JViewport does work with JPanel, but when I build a new class that extends JPanel, it seem as if the JViewport is ignore by the program. I don't know if I do anything wrong, so this is the test I conduct and still get the same…
user385261
  • 4,069
  • 8
  • 26
  • 24
1
vote
2 answers

Java swing -- Jpanel not rerendering/repainting itself

Im using a JPanel with propertyChangeListener and want it to rerender itself based on whenever a particular variable model changes. My code for the same is as follows -- public class LabelMacroEditor extends JPanel implements PropertyChangeListener…
ping
  • 1,229
  • 3
  • 21
  • 41
1
vote
1 answer

Communicating between JPanels

First off, I'm new to Java, so please be gentle. I have a JFrame which has two 'JPanels', one of which is a separate class (i've extended the JPanel). Ideally I'd like to 'dispatch and event' or notify the other JPanel object on the JFrame. I have…
Jonathan
  • 61
  • 1
  • 6