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

Stacking JPanels on top of other

I have created 5 very similar panels that are suppuosed to be visible in the same area of a frame on at a time, What I mean is that when the app stars one of them (JPanel0) is visible and the other four are created but invisible and when i hit…
Ignacio
1
vote
3 answers

What is happening with JPanel in java? What am I doing wrong?

I'm having a problem with my JPanel. I tell it to repaint() at the end of the constructor and then I have animation (one sprite moving on the screen), but the JPanel doesn't paint itself until the sprite has gone through its animation and reached…
user1208865
  • 587
  • 2
  • 6
  • 7
1
vote
2 answers

Good way to do simple walking animation?

I am writing a simple 2D game where any enemy walks toward you and you have to shoot him. Right now I am animating the walking by creating an array of all 8 different images, and then cycling through them every 5 ticks. Is there a better or simpler…
user1150769
  • 395
  • 1
  • 4
  • 17
1
vote
2 answers

Adding scrollbars and image resizing issues

Ok so for those of you that have actually seen my posts, my code has evolved nicely to the point that i can now display my sprite sheet the way i want. Here is my code: import java.awt.Graphics; import java.awt.Image; import…
1
vote
1 answer

Setting Dimensions Of JPanel on JTabbedPane in JInternalFrame in Java

Users of my software need to be able to click on different tabs to see different types of data representations. However, the code I am including below does not show the requested data panel when the user clicks on a tab. You can re-create the…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
1
vote
1 answer

Weird JPanel behavior when calling repaint()

I have a class PanelFormes that extends JPanel, which I use as a container. I also have two other JPanel, one to paint some figure in it, the second one contains buttons. These two JPanel are included into the first one, using BorderLayout. One my…
CTZStef
  • 1,675
  • 2
  • 18
  • 47
1
vote
1 answer

Remove unnecessary spaces from Swings Components

I have 3 JPanel, the first is the base panel and the other two are added to the first. I have realised that there is a lot of space that is not used, shown by the black color and the white color around components. How do you remove this space?
n002213f
  • 7,805
  • 13
  • 69
  • 105
1
vote
1 answer

Displaying JPanels plus its components in a tab within a JFrame using each tab as a seperate class

Please I need some help. I am trying to create a JFrame to contain Tabs, and each tab will show one panel. Each panel contains buttons and Textfields. The panels are should show a separate class on each tab but the panels show without the buttons…
Iyemwen
  • 11
  • 1
  • 1
  • 5
1
vote
1 answer

JPanel doesn't load in JFrame

I have a problem showing my progress bar when reading a file in Java. All works as intended, user choose a file, the program must show the progress bar (but it loads an empty blank frame), process the file and then load the results on another…
1
vote
1 answer

understanding how to create shapes

Hi I am trying to create simple shapes such as a rectangle and view it in the android emulator , I do not want to use android xml but java code as I will need to apply an accelerometer to it. I am using eclipse but I do not understand how I can use…
user1169775
  • 43
  • 2
  • 8
1
vote
2 answers

how to display a JPanel inside a JScrollPane?

I am designing a Pizza Delivery simulator for a class project. My team and I have most of it done, but we are struggling with the GUI. I need to be able to add items to the order. Each time I click the add item button, it creates a new AddItemPanel…
Matthew Denaburg
  • 163
  • 1
  • 15
1
vote
1 answer

Trying to learn the ins and outs of javax.swing

So I've been trying to get the handle of javax.swing and am having some trouble. I am attempting to implement the '8 puzzle', where there are 8 tiles and one open spot set up in a 3x3 grid, when a tile adjacent to the open spot is clicked it trades…
user535877
  • 31
  • 2
1
vote
1 answer

JPanel not updating when my ArrayList of GamePieces changes

I have a simple game that is in progress. As of right now all I want to do is click the green button and have the fifth and third pieces switch places. The paintComponent is called after the swap in the arraylist is made, but the JPanel is not…
1
vote
0 answers

Add Radiobuttons to JPanel at runtime in Netbeans

I am creating a JFrame Form in Netbeans. I have an Employee table in database. What I am trying to do that when this page loads, it will display employees record row-wise in jframe form. I have dragged JPanel to JFrame, and added radiobuttons(for…
Azeem
  • 2,904
  • 18
  • 54
  • 89
1
vote
1 answer

Why it shows scrollbar to JScrollPane when we use setPreferredSize for the JPanel which is added to JScrollPane

Please see the following block of code import java.awt.Color; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; public class test extends JFrame { …
Param-Ganak
  • 5,787
  • 17
  • 50
  • 62
1 2 3
99
100