3,978 Topics

Member Avatar for
Member Avatar for emmas4impact

I am working on a moving object. so I created a menu bar for size and speed, the idea behind it is that each time small, big or medium is clicked it should change the size and same also applies to the speed but when implement the action listener its …

Member Avatar for emmas4impact
0
210
Member Avatar for javaNooblet

Hi all, I have a main GUI class as seen here: [CODE] import java.awt.*; import javax.swing.*; import javax.swing.border.*; /* * Class is to communicate with various other classes in the program to * create a roster for user based on their selection on GUI. */ public class MainGUI extends JFrame …

Member Avatar for stevanity
0
263
Member Avatar for emmas4impact

Hi everyone, i'm trying to make a sound each time a ball touches the lift and right of a frame but when i use clip and try to use the sound class it sound from right then left the in middle and then stop. i Can really use some help. …

Member Avatar for JamesCherrill
0
212
Member Avatar for lbgladson

I have a program to write an application that takes the initial balance, annual rate, and number of years and finds the balance of the account at the end of each year. I have the following code but my Annual Rate label is in the incorrect place, the calculate button …

0
77
Member Avatar for Capn_Pipp

#1 - I'm a newb to java :( #2 Im having a problem getting getting my JTable to update when the user edits a cell. Im using a abstract model which is basically what the sun tutorial did word for word( i used a abstractmodel so i could make columns …

0
139
Member Avatar for jhamill

So i made a face using several ovals, a arc, and a polyline in the graphics class. I want to be able to change the size of the face based on the number input into the JTextField. Right now the value for the textfield is the variable "size" in the …

Member Avatar for mKorbel
0
1K
Member Avatar for angeriel1

the program runs but fails to read the double word states (e.g New Jersey). am getting the error.java.lang.NumberFormatException: For input string: "Hampshire" [CODE] import java.text.DecimalFormat; import java.util.*; import java.io.*; import java.lang.reflect.Array; import java.nio.CharBuffer; import java.awt.*; //import java.awt.event.*; import javax.lang.model.type.ArrayType; import javax.swing.*; import javax.swing.event.*; public class PJ5 extends JFrame implements ListSelectionListener …

Member Avatar for hfx642
0
223
Member Avatar for nsyncpilu

Hy , Is there any way to remove the windows borders (the upper with the name and (space) close , minimize , maximize ,the right one , left , down) from an java app? I develop the app in NetBeans , so here is my code for opening the "main" …

Member Avatar for nsyncpilu
0
906
Member Avatar for coolsport04

Hello. I am trying to get back into Java and wanted to start by trying to make a functioning GUI calculator. I have the basic framework for it, but I am having some trouble with the operator. I would like to take what is on the textfield and put that …

Member Avatar for coolsport04
0
928
Member Avatar for daneaum

[B]I have created a static Main class called ProductButtonTestDriver, that will run my class ProductButton.java- the prof wants a picture of each coffee shop item, with the name and price to appear in a button, then a check box if the customer selects that item- I am only on the …

Member Avatar for daneaum
0
1K
Member Avatar for shady05

[code]//This is the coding that I have done in delete item private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here int selectedIndex = jList1.getSelectedIndex(); jList1.remove(selectedIndex); }[/code] its throwing following Exception [code=text]xception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1 at java.awt.Container.remove(Container.java:1132) at musicplayer.jButton2ActionPerformed(musicplayer.java:144) at musicplayer.access$100(musicplayer.java:23) …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Pravinrasal

[B]can anyone help me to draw clock cycle in java using swing when i give 5 clock then it will show me 5 clock cycles[/B]

Member Avatar for JamesCherrill
0
217
Member Avatar for TigerTeck

Directions...Write a program SumOfOdds that has one main method that asks the user to input two odd integers where the first is smaller than the second. The program ouputs the sum of all the odd integers from the smaller output to the larger output. You must use a while loop …

Member Avatar for leodash
-1
164
Member Avatar for ali11

can someone help me to fix my codes.I am receving some errors.This is my first time i am using stack in GUI. [CODE]import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.Scanner; public class CalcGUIPanel extends JPanel { //=============================================== instance variables //--\- Component referenced during execution private JTextField …

Member Avatar for NormR1
-1
220
Member Avatar for PriyalRao

I have code for moving boxes but it have slider to control speed and tilt of boxes. I want to remove these sliders without stopping auto move effect. Can anybody convert this code to simplest? Please help Thanks in advance. [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html …

Member Avatar for PriyalRao
0
261
Member Avatar for BuhRock

So I have to program this MVC GUI of a checkout line. I have a gui that has 10 registers. Each register has a queue of customers. There is a button that when clicked, will generate a customer and the customer will be entered in the line with the shorted …

Member Avatar for JamesCherrill
0
213
Member Avatar for sajithdil

Hi guys I have written a class that uses a frame and Swing components. Unfortunately the traversal policy that i wrote does not seem to work for the jmenu. Can u guys help me fox it....much appreciated [code] public class MainFrame extends JFrame { //<editor-fold defaultstate="collapsed" desc="Variables"> JMenuBar jmb = …

0
90
Member Avatar for angeriel1

I have the folowing code so far which outputs the make and price of a car,but i cant seem to figure out were to add the discritpion of the car so that it can also be diplayed.HELP! i tried adding discription[k] = st.nextToken(); but the program did not run. [ICODE]import …

Member Avatar for mKorbel
0
210
Member Avatar for skywire_

Hello, I was tasked to make a program that reads data from a text file and then place it into a JTable. I managed to read the file and split the strings but I don't know how to put the strings into a format accepted by JTable. Please help. This …

Member Avatar for mKorbel
0
2K
Member Avatar for ITHope

So my java pprgram is actually a GUI I did all of it except I cant figure out how to convert between bases example: number=2239 base=3 newbase=4 first i need to convert 2239 to base 3 which would be 2 * 3^3 + 2* 3^2 + ..... then convert that …

Member Avatar for JeffGrigg
0
115
Member Avatar for Kayla1809

Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to …

Member Avatar for mKorbel
0
102
Member Avatar for ali11

First i create simple claculator.but now I am trying to change it to RPN calculator by using stack.Can some one help me because I don't know alot about stack.here is my codes so far. [CODE] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.Scanner; public class CalcGUIPanel …

0
87
Member Avatar for shujat132

Hello Dear Brothers and sisters How are you................? I'm Student of bscs in 6th semester i write three programs but all of these are giving errors and i'm not able to findout probelm. but i thing problem is some where with CONTAINER please check all these Thanks [COLOR="Red"]First One[/COLOR] [CODE]import …

Member Avatar for NormR1
0
1K
Member Avatar for jhamill

So I had to make a program that calculates the volume of sound at a different distance, given a reference difference, and sound level, and the new distance. It works sometimes but depends on what values I put in. Much of the time it tells me the new volume level …

0
98
Member Avatar for jhamill

Hey so I've been working on a lab for my intro to software developing class and have been trying to get my program to work for several days now. It's a real basic program, im sure someone will be able to figure out the issue im having. Hopefully once I …

Member Avatar for jhamill
0
233
Member Avatar for ali11

can somebody help me with switch statement. [CODE] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; import java.util.Vector; public class Ahsan extends JFrame{ Stack s = new Stack(); private JFrame f; private JPanel p1,p2; private final int ADD = 1; private final int SUBTRACT = 2; // declare …

Member Avatar for JeffGrigg
0
2K
Member Avatar for ali11

First i create simple claculator.but now I am trying to change it to RPN calculator by using stack.Can some one help me((especially where to use pop method) because I don't know alot about stack.here is my codes so far. import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import …

Member Avatar for ali11
0
139
Member Avatar for lbgladson

I have an assignment to create Random Shapes by creating a method randomShape that randomly generates objects implementing the Shape interface. This is what I have so far and don't know where to go from here. [code] import javax.swing.JFrame; public class RandomShapeViewer { public static void main(String[] args) { JFrame …

Member Avatar for JamesCherrill
0
160
Member Avatar for elkowalski

i am trying to load images for an applet using imageicon but i found out that it doesnt work so i was wondering if there is other way to load em. by the way i am trying to load them in another class that is not the main one. this …

Member Avatar for NormR1
0
153
Member Avatar for digan

Hi I am trying to make a program that prints a snooker board on the screen. I am trying to print the different parts on top of each other. So far all I am able to do is print the background. when i try to print the cloth on top …

Member Avatar for hiddepolen
0
388
Member Avatar for grako84

Hi Folks! I got to game (know as concentration or memory)code for my assignment. I have found many similar tasks, but mine is a bit different. Our teacher asked us to implement comboBox that we could switch between images and text version. So far I have made image one, and …

Member Avatar for grako84
0
256
Member Avatar for applejax77

Looking for Java help! I am working on the payroll program below and would like some help please. When I run the prograom, I am using jGrasp, the program runs with no errors identified in the code but I get the following window that pops up...."No main methods, applets, or …

Member Avatar for hfx642
0
2K
Member Avatar for RaigaX9

Hello again everyone, on my recent thread about my rock, paper, scissors program, I had trouble running it from Applet to JApplet and that problem was solved. So far, I've added many functions for the program such as menus, checking your score, resetting the score, and setting the number of …

Member Avatar for jackmaverick1
0
446
Member Avatar for je5ter461

below is my current code for a math game i'm having problems creating the answer checking part of it, any assistance is appreciated. [code] import javax.swing.*; import java.util.Random; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Event; import java.awt.event.*; import javax.swing.*; public class MathPanel extends JPanel { // Declares Labels and …

Member Avatar for je5ter461
0
209
Member Avatar for DaniwebOS

Originally I had the program all in main but I wanted to separate this by having the comparison method (diamond of asterisks) in its own method. For some odd reason I'm getting weird errors that won't allow the program to run. Errors below: 1) Systan error on token "," delete …

Member Avatar for DaniwebOS
0
297
Member Avatar for revjim44

I'm new to Java (2 weeks) and was given a class assignment to create a program that takes a 5 digit number and checks to see if it is a palindrome (same forwards as backwards.) The requirement stated to use the methods main(), retrieveInput(), check(), and display(). My code works …

Member Avatar for hfx642
0
218
Member Avatar for Erlendftw

Hello there Daniweb community, i am creating a 2d game in Java, however i have a problem. I googled up KeyListeners for JFrame, as they didnt work as usual, and i found out that when using KeyListeners with JFrame you have to set focus, right? Well. I have Googled abit …

Member Avatar for Erlendftw
0
151
Member Avatar for j23

hi, how do you get the html file to run the java applet in a webbrowser. I need to have a html file which will allow me to view this applet in a web browser. im using eclipse to write the code for the applet. [CODE] import java.awt.Graphics; import javax.swing.JApplet; …

Member Avatar for Taywin
0
192
Member Avatar for ali11

I have no idea what wrong my cods when I press = button of my calculator nothing happens. [CODE]import java.util.Stack; import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; import java.util.Vector; public class Ahsan extends JFrame{ Stack s = new Stack(); private JFrame f; private JPanel p1,p2; private JTextField …

Member Avatar for JeffGrigg
0
767
Member Avatar for jinglylime

Hi, I'm having trouble with setting up my table. How do i get the header to show initially. I want "code", "Number" and "Value" as the header. And I want to know if the way i added the table is correct? Can you help me please. Thank you! [CODE] import …

Member Avatar for mKorbel
0
97
Member Avatar for KhaosElement

I'm 'spose to be making a screen saver-ish program where objects bounce off the walls, but I'm stuck getting multiple objects to show up on the screen at once. This is my object to make a square: [CODE]package movingshape; import java.awt.Graphics; import javax.swing.JPanel; import java.awt.*; import java.util.Random; public class Shapes …

Member Avatar for mKorbel
0
1K
Member Avatar for TigerTeck

Grade2 Class.... [CODE]public class Grade2 { public Grade2(double input) { Grade = input; } public String getLetterGrade() { if(Grade==(4.0)) message="A+"; else if(Grade>=(3.85)&&Grade<=(3.99)) message="A"; else if(Grade>=(3.7)&&Grade<=(3.8499999)) message="A-"; else if(Grade>=(3.01)&&Grade<=(3.3)) message="B+"; else if(Grade>=(2.85)&&Grade<=(3.00)) message="B"; else if(Grade>=(2.7)&&Grade<=(2.8499)) message="B-"; else if(Grade>=(2.01)&&Grade<=(2.3)) message="C+"; else if(Grade>=(1.85)&&Grade<=(2.00)) message="C"; else if(Grade>=(1.7)&&Grade<=(1.849999)) message="C-"; else if(Grade>=(1.01)&&Grade<=(1.3)) message="D+"; else if(Grade>=(0.85)&&Grade<=(1.00)) message="D"; …

Member Avatar for TigerTeck
0
145
Member Avatar for greatcornholio

Hi all, Im new to java, and im working with j lists importing data from sql server. Thing is that i can import the data from the sql tables, but for some reason it does not refresh properly. Thing is that when the frame is opened the list is filled …

Member Avatar for mKorbel
0
242
Member Avatar for Lendaanx

Need help getting my add, save, search, modify, delete buttons to work I can get them to show up in the GUI but pressing them does nothing. I need the save button to save file to index.dat in folder c:\\data\ folder and create that folder if it doesn't exist [CODE]import …

Member Avatar for JamesCherrill
0
158
Member Avatar for jwala

I tried to broadcast an object using object serialization and UDP connection. I am using netbeans IDE and i use a Java Desktop Application for both sending and receiving ends.Obect is broadcasted when a button is clicked. And i get the following exception... Oct 29, 2011 1:50:04 PM receive1.Receive1View jButton1ActionPerformed …

Member Avatar for peter_budo
0
369
Member Avatar for ali11

I need help in creating a RPN calculator! I'm currently stuck in making a stack. here is my codes so for.This is my first time I am using stack. [code] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; public class JavaCalculator extends JFrame{ Stack s = new Stack(); …

Member Avatar for stultuske
0
546
Member Avatar for ali11

I need help in creating a RPN calculator! I'm currently stuck in making a stack. here is my codes so for. [CODE]/** * * * */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; public class JavaCalculator extends JFrame{ private JFrame f; private JPanel p1,p2; private JTextField jtfMain; private JButton …

Member Avatar for JeffGrigg
0
294
Member Avatar for DaniwebOS

Question for you guys, what am I doing wrong here? I am able to enter the 5 digits in one input and I just want it to display the first character; just to test to see if it works. Afterwards I will be displaying all 5 characters like "1 2 …

Member Avatar for hfx642
0
167
Member Avatar for dnyansagar

Hi everyone. I have been using ubuntu for a while now. But this recent upgrade of ubuntu from 11.04 to 11.10 has caused me some problems. Mainly that some java applications are not running properly. I was using Figtree(phylogenetic tree app.) which was working fine until this upgrade. Now everytime …

Member Avatar for dnyansagar
0
223
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
194

The End.