So I am trying to start a graphics program, where I have a JFrame that holds multiple JPanels. The JPanels need to combine to create 1 image, however when I run my program I see borders around the images. I cannot quite distinguish if the border is caused by the JLabel that holds the image or if it is because
Tag: jpanel
How to add multiple JComponents to a JPanel?
I’m trying to add multiple components to a JPanel, but only the most recently added component is displaying. It seems like the problem is that the layout can only handle 1 component at a time, but I’m at a loss as to how to actually fix it. I’ve tried adding the components to a separate panel and then adding that
Alternating between even and odd elements in Array with GUI
I’m trying to work with more GUI stuff but I’m having problem with something. I have an array of JLabels. Each of them contain 1 number from 0 to 7. I’m making the numbers “light up” by changing …
how do i use an image in java gui
Hi im making a Gui programme using a null layout and a setBounds() method for lay out . In the programme I want 25 strings printed out on the screen in random locations . I know that i could do this with a for loop however i have been trying this to no avail. I have been trying this and
How to increase the slow scroll speed on a JScrollPane?
I am adding a JPanel in a JScrollPane in my project. All is working fine, but there is one problem about mouse scroll using the mouse-Wheel in JPanel. It’s speed is very slow on scrolling. How to make it faster? My code is : Answer You can set your scrolling speed with this line of code Here is details.
Making a JPanel manually resizable
I have a JFrame with BorderLayout as the layout manager. In the south border, I have a JPanel, I want this JPanel’s size to be adjustable by the user, i.e. the user can click on the edge of the border and drag it up to make it larger. Is there any way you know that I can do this? Answer
Java get JPanel Components
I have a JPanel full of JTextFields… How do I later get the JTextFields in that JPanel? Like if I want their values with Thanks Answer Well bear in mind they didn’t get there by them selves ( I think a read some questions about dynamically creating these panels at runtime ) In the answers posted there, someone said you