59 Topics

Member Avatar for
Member Avatar for powerdink

I need some help. I'm trying to create a number pad like a cellphone that captures user input by pressing buttons in a panel on the left and displaying what the user punches in the top panel. Then I have a clear button in the panel on the right to …

Member Avatar for JamesCherrill
0
186
Member Avatar for ecclesiastes3:1

Good Day... the problem is that the Jbutton is not displaying in my Jpanel. can you help me, this will help me a lot, Thanks Here's the code [CODE] import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URL; import javax.swing.JButton; import javax.swing.JOptionPane; public class GameBoard extends JPanel implements ActionListener { JButton …

Member Avatar for ecclesiastes3:1
0
294
Member Avatar for teo236

I want to redraw a JPanel while my program is running. Here's a fragment of my code: [CODE]public class Graph extends JPanel{ public void redrawSomething() { getGraphics().drawRect(15, 5, 20, 5); repaint(); }[/CODE] I tried to call "redrawSomething" but nothing happend. How do I fix it? Is something wrong?

Member Avatar for teo236
0
235
Member Avatar for JSS540

Hi, I have a jFrame with a couple of jLabels, designed in Netbeans so most of the code is generated. If I want to change the text of the label, I use .setText() inside my jFrame and it works great. Now here's the problem. If I just make a String …

Member Avatar for JamesCherrill
0
1K
Member Avatar for matadori

I'm trying to remove a JButton from a JPanel but my code does not work. Any help is appreciated. This is the JButton. Problem is the line 25 I guess. [CODE] class SquareButton extends JButton implements MouseListener { String text = null; GameArea ga = null; public SquareButton(GameArea ga) { …

Member Avatar for mKorbel
0
2K
Member Avatar for gema002

Hi you all! I hope someone here will help me, i have workt with my java-program for 14 hours and i cant get it right. Im sure im on the right way but i cant get i all right. ok.. first i have to create a dice-class that generates random …

Member Avatar for stultuske
0
209
Member Avatar for guru_iyer

I am trying to change the background color of the JPanel every 3 seconds (3000 ms) when I click START button till I press STOP button. [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Random; class TimerBackground implements ActionListener { JFrame frame; JPanel panel; JButton btnStart; JButton btnRed; JButton btnGreen; …

Member Avatar for guru_iyer
0
1K
Member Avatar for SMITA6076

I have a [ICODE]JFrame[/ICODE] window to which I am trying to add 3 panels. One panel is for input (text areas and their labels which I already have arranged within the panel), one is for a set of buttons, and one is for output. I want the the input and …

Member Avatar for JamesCherrill
0
385
Member Avatar for sariberri

I need to add a border around the Size label and the small, medium and large buttons so I thought I would add them into their own Panel and then add that panel to the mainPanel but when I do that they do not show up. What am I doing …

Member Avatar for Ezzaral
0
286
Member Avatar for RagingRiver

I am having a problem with left alignment after adding a second JPanel. Both JPanels are using the BoxLayout with the first set to Y_AXIS and the second set to X_AXIS. If you comment out the add(twoPanel) it results in the desired left alignment. I don't understand why the alignment …

Member Avatar for Ezzaral
0
406
Member Avatar for musikluver4

I have a JFrame with 2 JPanels...my problem When I attach one of the JPanels to the JScrollPane object, it encompasses the whole JFrame, instead of just the JPanel I said to attach to. The scrollBar goes all the way up to the top of the JPanel I don't want …

Member Avatar for musikluver4
0
733
Member Avatar for jabanista

I'm in the process of creating a program that would change a background color by pressing a button. Now, I already have everything set up. The background image is just an image of a rainbow, and when a button is clicked, it would change the whole background color. The thing …

Member Avatar for jabanista
0
1K
Member Avatar for SCass2010

Hi everyone, For a group assignment we have to develop a property trading game similar to monopoly. At the moment we have the GUI developed as well as a basic idea of how to go about doing it but was wondering if anyone could help a bit!:S Is it possible …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for DDirectJ

i'd like to ask how one can get rid of all the components in a JPanel (buttons, labels, comboboxes etc), so that you can add new components (at run time that is)

Member Avatar for DDirectJ
0
164
Member Avatar for Progr4mmer

I wanted to know if its possible to change the text of a JTextArea or JTextPanel from another method and if so how?

Member Avatar for Progr4mmer
0
194
Member Avatar for gordsmash

Hi! Basically what im trying to do is to add a JPanel onto another JPanel that has painted graphics on it using the paintComponent() method. But the JPanel I am trying to add is not shown because it is covered up by the JPanel w/ Graphics on it. How can …

Member Avatar for Ezzaral
0
91
Member Avatar for Taimoor Rana

I want to load an image for each different shoe and I'm using JLabel to help me do this. I put the image's path in the JLabel constructor but when the code runs, it doesn't display any image. Instead of an image, the image path is written. appreciate any help …

Member Avatar for ztini
0
242
Member Avatar for hauda67

Basically what I would to know is you have a button on one JPanel, and when the user clicks it, they are re-directed to the other JPanel. I would appreciate it if i could have some sort of hint or know about the overall structure of implementing this. Thanks,

Member Avatar for mangopearapples
0
123
Member Avatar for mindbend

I'm trying to make family tree webapplet, to test it out outside of the site I just used JFrame. I've used GroupLayout to set up things, but I'd like to have a fixed size, now it just takes up the size of the JFrame. NewClass.Java [CODE=java] /* * NewJPanel.java * …

Member Avatar for mindbend
0
2K
Member Avatar for ajst

Hi, I'm trying to use JAVA GUI for first time. I've got a Jframe that when loaded adds a jpanel. the problem is it will not show any swing controls that get added to the jPanel. I'm using netbeans 6.9.1. any idea to why is happerning would be greatful [CODE] …

Member Avatar for JamesCherrill
0
3K
Member Avatar for lee.j.baxter

Hi, I'm creating a component for a process flow charting system, and have come to the point where I need to implement D&D between components. I have a panel containing expanding lists, where each list item represents a process definition. What I need to do is the following. Altogether, I'm …

Member Avatar for kramerd
0
224
Member Avatar for pi_lord12

I'm making a JPanel for a game. I want the background to be an imported image, so I set up a ClassLoader to import the image and converted that to a URL. However, that URL appears to be null, as when I try to put the panel into a JFrame, …

Member Avatar for pi_lord12
0
153
Member Avatar for leiger

I'm trying to list a bunch of buttons vertically, but am having problems even getting that much done. I'm pretty sure I have the scroll pane working (it just isn't being used yet so I can't test it). This is part of an assignment so I'd prefer not to post …

Member Avatar for leiger
0
2K
Member Avatar for xx_kandikidd_xx

Hi, I'm having trouble with my Java code. It's meant to read in from a csv file and update the elements on the GUI to reflect this e.g. as it reads in one line, images and text appear on the GUI reflecting the data. Anyway, to get the GUI to …

0
93
Member Avatar for ismithx

Hello there I am looking for some help. How can I go about creating a list of JPanels in Java? I want them all to have subcomponents, to be created dynamically, and be able to return events. How can I do this? I have checked and I know I will …

Member Avatar for BestJewSinceJC
0
139
Member Avatar for Nicky4815

Hi, I'm working on a dissertation based around graph visualization. I need to make a GUI for my program but I am having trouble getting the JPanels to display what is required. My code so far: [code] //Class to create the GUI import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Component; import javax.swing.JFrame; …

Member Avatar for mr.george
0
130
Member Avatar for Ecliptical210

Hi guys, I'd really appreciate it if someone could look over my code and tell me why my JComboBox isn't working. I've got 3 Classes, 2 for the GUI, one for the standalone which the array is contained in. [CODE]import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JComponent; import javax.swing.SwingUtilities; import …

Member Avatar for javaAddict
0
155
Member Avatar for CuteCat

I don't know what to do... I've been trying for weeks to figure out the problem. You see, I'm supposed to make a game, as a project for school. Since it's going to be a rather large game, I decided not to flood the main file with a bunch of …

Member Avatar for CuteCat
0
186
Member Avatar for Shigekazu

Hello all, I'm trying to add a multiple JTextFields onto a single JPanel that has been already initialized thanks to the Design tool from the JFrame. I'm pretty sure that I already added them and I'm not getting any errors but they aren't showing up when I execute the program. …

Member Avatar for quuba
0
158

The End.