3,978 Topics

Member Avatar for
Member Avatar for jhamill

Hey all, so now im trying to code a simple game where each time an image is clicked on it is randomly regenerated somewhere else on the JFrame. I'm having some trouble with the logic though. Any help would be appreciated, thanks! heres all the code, theres 3 classes [CODE]package …

Member Avatar for JamesCherrill
0
138
Member Avatar for khaled_jawaher

i m using mtom feature in jaxws web service to send image from server to client and i m getting the following error pls i apreciate any help. error is Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/x ml/stream/buffer/XMLStreamBuffer at com.sun.xml.ws.api.addressing.AddressingVersion.<init>(AddressingVers ion.java:436) at com.sun.xml.ws.api.addressing.AddressingVersion.<init>(AddressingVers ion.java:67) at com.sun.xml.ws.api.addressing.AddressingVersion$1.<init>(AddressingVe rsion.java:146) code is [CODE]package services; …

Member Avatar for ~s.o.s~
0
568
Member Avatar for grako84

Hi folks! I'm trying to wire simple code and so far I'm stuck on ActionListener. My program should contain (JMenu) Menu called SELECT and two options InnerFrame 1 and InnerFrame 2. To debug it I've started using System.EXIT , unfortunately I cant compile my program, I'm receiving an error: "java:48: …

0
123
Member Avatar for Daigan

Here's what I have so far.. [CODE] // The "AddingPrefixes" class. import hsa.*; import javax.swing.JOptionPane; public class AddingPrefixes { static Console c; // The output console static char proc; static String prefix; static String word; static String sentences; private void title () { c.print (' ', 32); c.println ("Adding a …

Member Avatar for NormR1
0
181
Member Avatar for jazz_vill

I have a Java Desktop Application I made and I am now on the process of deploying the application. I tried to use Java Web Start but came up with certain problems. My application is fully working when I start it locally or inside my IDE. But when I try …

0
136
Member Avatar for slasherpunk

I have created a window containing only one button(park1). All I need is a new dialog(with "OK" and "Cancel" buttons to open when I click on park1. Thanks in advance. [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; class MyWin extends JFrame implements ActionListener { JButton park1; MyWin() { setSize(450, 500); …

Member Avatar for mKorbel
0
3K
Member Avatar for upanotch

I'm trying to make my first real project: A calculator, but when I press the "clear" button (the only button i've done so far) the JLabel doesn't go from two to zero, any help would be really appreciated :) code: [CODE]import java.awt.Color; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; public class …

Member Avatar for stultuske
0
137
Member Avatar for SeasideP

Hey i was wondering if someone could have a look at this and help me figure out why the output is repeating it's self and how I would fix it. I have spent several hours trying to fix this. Thanks in advance. [CODE]/* Author : * Date :02/10/10 * Title: …

Member Avatar for SeasideP
0
89
Member Avatar for Alviery

Can anybody help mi getting the area so that I display it on a message? Here is the driver: import javax.swing.JOptionPane; public class Driver { public static void main(String[] args) { Rectangle tennisCourt = new Rectangle(); { JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setLength() ); JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setWidth() …

Member Avatar for stultuske
0
124
Member Avatar for Alviery

How do I set a new salary and a new department for the emp1 object class using a setPosition method. Everything works except that for some reason I just can't show the results on Message. Here is the Driver: import javax.swing.JOptionPane; public class Employee { public static void main(String[] args) …

Member Avatar for thines01
0
100
Member Avatar for umsungun

[code]import java.util.*; import javax.swing.JOptionPane; import java.text.*; class playGames{ public static void main (String [] args){ Fermi fermi; fermi = new Fermi(); int num1 =fermi.fermi1(); int num2 = fermi.fermi2(); int num3 = fermi.fermi3(); boolean playGame = true; int firstGuess; int secondGuess; int thirdGuess; String inputStr; inputStr = JOptionPane.showInputDialog(null, "Enter the First …

Member Avatar for NormR1
0
196
Member Avatar for nsyncpilu

Hy , I am using netbeans to create an app. I wanted to eliminate the windows buttons (minimize , maximize , exit) so i could have full control on the exit button , and i used setUndecorated(true) in the PuppetApp.java (main app that netbeans creates). Now i created a exit …

Member Avatar for NormR1
0
1K
Member Avatar for th3b3n

the following code is used to get the contents of an excel document and pint it to console - will eventually filter and write a new excel file, but that will come later. [CODE]/** * */ import java.io.*; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.swing.*; import java.awt.*; import java.awt.event.*; …

Member Avatar for th3b3n
0
209
Member Avatar for nered

Hi, [CODE] package guiInt; import java.awt.*; import javax.swing.*; import javax.swing.tree.*; public class Init { public Init() { } void buildFrame() { JFrame window = new JFrame(); window.setTitle("Pos Setup Tool 0.1 Alfa"); window.setSize(800, 600); window.setResizable(false); JPanel sidebar = new JPanel(new GridBagLayout()); sidebar.setPreferredSize(new Dimension(250, 600)); sidebar.setBackground(Color.black); JTree tree = buildTree(); JScrollPane sidebar_placement …

Member Avatar for nered
1
136
Member Avatar for persianprez

So I have this small program that draws circles of different colors depending on "velocity" Below is my code, btw I haven't actually implemented velocity yet. When I run it, I get these"[CODE]Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException at Mouse.paintComponent(Mouse.java:35) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown …

Member Avatar for JamesCherrill
0
130
Member Avatar for gahhon

[CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class ClientProgram implements ActionListener{ //static FilmCollection collection = new FilmCollection(); static boolean condition = true; static int memberPassword = 123; static JButton button1, button2, button3; public static void main(String[] args){ int mPassword; JFrame myFrame = new JFrame("Member Login"); //window's title myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//perform exit when …

Member Avatar for thines01
0
276
Member Avatar for Danielhuo

I am writing a Java program, a MP3 Manager, but I have problems to work with buttons, TextFields, and TextArea. Here are the problem descriptions. Create a class MP3 with instance variables for: artist, song, album, track length (in seconds). Provide a constructor, get/set methods, and a toString. method. The …

Member Avatar for Danielhuo
0
1K
Member Avatar for BDan

I have my two JTextFields identified in a GridLayout, but when I try to reformat them the stay as large as their positioning allows. I have tried to specify the size of the field but it never changes on the final product. Could this be because the GridLayout or something …

Member Avatar for BDan
0
172
Member Avatar for applejax77

Okay getting quite frustrated! I am trying to get an if statement to implement a pop up window when the user fails to enter any information in one of the JTextFields like fnameTF. Here the if statement but where do I place it to work in my program? [CODE]if (fnameTF.getText().length() …

Member Avatar for NormR1
0
1K
Member Avatar for applejax77

Here I am again! I am working on the program below that is calculating payroll but am kind of lost on how to program the reset button after the net pay has been calculated. Any and all help would be greatly appreciated. Thanks. [CODE]import java.io.*; import java.util.*; import javax.swing.*; import …

Member Avatar for applejax77
0
9K
Member Avatar for Danielhuo

I am writing a program, but I cannot find what is wrong with the code. Only need to show one MP3, or an error message if there are any missing fields or an incorrect entry for seconds. It is not storing information about previous songs; it just display the current …

Member Avatar for peter_budo
0
845
Member Avatar for spades0001

Hey guys! I've created this program that allows the user to get a .txt file from anywhere in the hard drive and it displays the contents in the text area. My question is: how can I edit my code so that it only allows picture files to be selected(jpg and …

Member Avatar for Ezzaral
0
143
Member Avatar for coolsport04

I am trying to write a program that kind of resembles and etch-a-sketch. I have the basis for it. I am having two problems: 1. When I draw a shape in the default black color, when I switch the color it changes the color of what I had previously drawn. …

Member Avatar for Ezzaral
0
215
Member Avatar for Muna Oman

Hello folk i am a new member n i need Ur help to do my course project for developing Sudoku game i already have my codes but i need a code for generating random numbers in the grid this is basically my code [code]import javax.swing.*; import java.awt.*; import java.util.*; /* …

Member Avatar for NormR1
0
658
Member Avatar for BDan

I am a fairly new programmer still in school, and trying to have my program write the selected information to a designated file. I keep getting an error message on my file OutputStream. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.text.*; class ExampleJComboBoxSample extends JFrame implements …

Member Avatar for Ezzaral
0
169
Member Avatar for rayden150

Im using netbeans gui editor and im trying to add a Jfreechart that is itself in a internal frame, and this internal frame I am wanting to add it to a panel, as you can see in this image: [url]http://www.flickr.com/photos/63259070@N06/6370734167/[/url] The internal frame doesn't even show up on the panel …

Member Avatar for mKorbel
0
357
Member Avatar for KSBeyaz

Hey guys i m trying to make hangman game as java application here is a simple run how it should be. [url]http://e.atilim.edu.tr/mod/resource/view.php?id=5240[/url] i m trying to put JLabels in order when player click correct buttons. firstly i added JFrames at first then i did setEnabled(false) them after button is clicked …

Member Avatar for KSBeyaz
0
244
Member Avatar for xiangzhuang

Hey guys, so this is what happened. I'm stuck on this project on the second part, which is the top right quadrant. Its not showing the graphics at its specified quadrant which is the top right. Its supposed to have randomized sized red blocks that fills the quadrant. Can you …

Member Avatar for hfx642
0
399
Member Avatar for Unsated

Hello everyone and thanks in advance for helping me. I'm a 1st year java student in my first semester of college. Its comming towards the end of the semester and finals are starting up.. well my problem is that my java teacher decided to give us 2 projects to work …

Member Avatar for Unsated
0
373
Member Avatar for jhamill

So I wrote up a simple voting GUI, but I havent been able to figure out how to get it to display the current leader or how many votes they have. It displays the total number of votes correctly, however. Heres my code [CODE]import java.awt.*; import java.util.*; import java.awt.event.*; import …

Member Avatar for harinath_2007
0
195
Member Avatar for lbgladson

I am trying to use a combo box to change the background color. I have the following code but it is not working correctly. The combo box is there with the three choices but the choices are not changing the color of the background. [code] import java.awt.BorderLayout; import java.awt.Color; import …

Member Avatar for Ezzaral
0
105
Member Avatar for lbgladson

I have the following code where I am trying to put an icon on the redButton but what I have done is not correct and I'm not sure what to do. There is no where in my book that explains how to do this and I keep getting confused looking …

Member Avatar for lbgladson
0
87
Member Avatar for lbgladson

I have to create a GUI that when I click on the buttons it changes the color of the background. Below is what I have but I can't figure out what code to put in and where to change the color of the background. [code] import java.awt.BorderLayout; import java.awt.Color; import …

Member Avatar for Ezzaral
0
5K
Member Avatar for upanotch

I tried to put an image on a JButton and it's messed up: [url]http://imgur.com/ecBOt[/url] code: [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; public class Polluted extends JFrame implements ActionListener { ImageIcon bg = new ImageIcon("bg.png"); Image bgImage = bg.getImage(); public static void main(String[] args) { new Polluted(); } public …

Member Avatar for NormR1
0
177
Member Avatar for jhamill

Hey so for my lab we were given this code and told to fix it so that each candidate's information is printed on the appropriately colored background. The voting space for sarah is supposed to be on a green background, and the voting space for joe is supposed to be …

Member Avatar for NormR1
0
197
Member Avatar for pote86

The following is my code for login function. I save the password as MD5 but inside the url after logged in it shows the full word instead of showing MD5. I'm still very new to Java EE and any help I can get will be very much appreciated. [CODE]<%@ page …

Member Avatar for pote86
0
2K
Member Avatar for FALL3N

[CODE]public class Example { private static void createAndShowGUI() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Window"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel emptyLabel = new JLabel(""); emptyLabel.setPreferredSize(new Dimension(175, 100)); frame.getContentPane().add(emptyLabel, BorderLayout.CENTER); frame.pack(); frame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }[/CODE] In The above …

Member Avatar for FALL3N
0
203
Member Avatar for sirlink99

I have an error when I shorten 3 lines of code to one. How come this code works [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Vector; public class Draw extends JPanel implements KeyListener, Runnable, ActionListener{ Vector<Wall> walls = new Vector<Wall>(); Vector<Enemy> enemy = new Vector<Enemy>(); Player p = new …

Member Avatar for sirlink99
0
222
Member Avatar for Dersev

Hello I have a small problem with Drag and Drop images. Class GridImage creates small thumbnails of images to 100 x 100px Image drag and drop is defined by mouseListener and mousePressed event. I know that actually I am copying component JLabel to class DrawImage with these settings. What should …

Member Avatar for NormR1
0
221
Member Avatar for applejax77

I am working on the payroll calculation program below and would like some help with the JTextField area. I would like the program to respond with a GUI window letting the user know that the JTextField is blank and must enter First name, last name, and so on. Any help …

Member Avatar for applejax77
0
1K
Member Avatar for powerdink

Hello all, I'm trying to inherit a "CarPanel" I created using arrays to draw various shapes in order to make a car. Now I am trying to essentially create a subclass that inherits that class, but add a Timer Action to move the car across the screen. I got it …

Member Avatar for JamesCherrill
0
509
Member Avatar for ali11

can somebody help. i m getting following errors. i m creating postfix calc C:\Users\Hamza\Pictures\CalcGUIPanel.java:204: int cannot be dereferenced Integer arg2=resultValue.pop(); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: operator + cannot be applied to <any>,java.lang.Integer resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:211: int cannot be dereferenced …

Member Avatar for JamesCherrill
0
147
Member Avatar for fmnajp

I am new to Java and I am having trouble knowing if my array is populating when I click the enter button and printing out the data into the text area when I click the run reports button. When I put data in the text boxes the boxes are being …

Member Avatar for fmnajp
0
195
Member Avatar for Pravinrasal

I want display 2nd cycle after sleeping 1st cycle time 1 second after that display 2nd ,3rd and so on.... I bold my thread code in above program.... [CODE] public class MainDrawCycle extends JPanel implements ActionListener ,Runnable { JButton button; JLabel lblclkValue,lbldispValue,lblTitle; JTextField textField; JScrollPane pane; JPanel panel; JFrame frame; …

Member Avatar for JamesCherrill
0
448
Member Avatar for sidra 100

hey i have written this code to make a GUI but it compile correctly but gives error at run time. the error is exception in thread main "java.lang.NullpointerException" at GUI.intGUI(GUI.java:22) at GUI.(init)(GUI.java :75) at GUI.main (GUI.java:79) the code is [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame …

Member Avatar for peter_budo
0
224
Member Avatar for sidra 100

i have jst started programing in java m beginer. m making gui which contains a two radio button a slider and a text message. although its compiling coreectly but it doesnot display any thing [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame frame; JLabel coord; JRadioButton Man=new …

Member Avatar for hfx642
0
128
Member Avatar for sidra 100

i m a begginer m making a GUI which consist of a slider and 2 radio button and a text message. i have not added the functionality in it yet. but its not displaying GUI it completes successfuly but at runing time it gives error Exception in thread "main" java.lang.IllegalArgumentException: …

Member Avatar for NormR1
0
94
Member Avatar for angeriel1

how can I use JList object in place of JFilechooser show the directory content.any tips or somthing to help me understand this will be apreciated. [CODE]// Display directory content in a JTextArea object. // The user selects a directory via JFileChooser object. import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; …

Member Avatar for JamesCherrill
0
155
Member Avatar for CSloan7597

Hey everyone. I have recently decided to try and learn how to use java Sockets for client/server communication, as well as swing and threads, etc. and have (pretty much) completed a small client server application. The application is basically a syntax-highlighting notepad, a client swing GUI which connects to a …

Member Avatar for CSloan7597
0
295
Member Avatar for ali11

Hi i m creating simple rpn calculator.I m getting following errors. C:\Users\Hamza\Pictures\CalcGUIPanel.java:63: array required, but java.lang.String found cStack.push(buttonOrder[i]); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:213: currentValue is already defined in actionPerformed(java.awt.event.ActionEvent) BigInteger currentValue = new BigInteger(cStack.pop()); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:215: operator + cannot be applied to java.math.BigInteger,java.math.BigInteger resultValue += currentValue; ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:223: currentValue is already defined in …

Member Avatar for NormR1
0
266

The End.