3,978 Topics

Member Avatar for
Member Avatar for BobbieJean

Hi, I'm supposed to write a program using super and subclasses to calculate monthly payroll for 5 employees. There are 4 types of employees, salaried, hourly, commissioned, and base plus commissioned. Anyway, I've gotten it to build with no errors and it runs almost like it should but since it …

Member Avatar for kvass
0
2K
Member Avatar for Old Geezer

Hey Gang; I'm new at this college thing, it's been a while. Need help trying to figure out why I am getting <identifier> errors. Here's my script. would sure appreciate any help you can give. Thanks ///////////////////////////////////////////////////////////////////////////////////// [code] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class TicTacToe extends Frame { …

Member Avatar for Old Geezer
0
119
Member Avatar for Old Geezer

Hey Gang; I'm new at this college thing, it's been a while. Need help trying to figure out why I am getting <identifier> errors. Here's my script. would sure appreciate any help you can give. Thanks ////////////////////////////////////////////////////////////////////////////////////// import javax.swing.*; import java.awt.*; import java.awt.event.*; public class TicTacToe extends Frame { // …

Member Avatar for caperjack
0
147
Member Avatar for kingsboro2008

This is my first working java game. I am thrilled it works. What I want to know is.... what can I do to improve it? I would like to use a simple datebase to collect every possible combination of computer names. I would like to collect new information every time …

Member Avatar for kingsboro2008
0
203
Member Avatar for bettybarnes

i have this problem with regards to java data the problem accepts input number and then output the sum of the square from 1 to the n(1 to the no. input) thus, if the input is 4 the output should be 288 because: 1 raise to 1 + 2 raise …

Member Avatar for huyyaya
0
98
Member Avatar for ku95

Hi basically I'm current doing a connect 4 program that consist of 3 separate programs Connect4Model, Connect 4 Column and Connect4View... I'm trying to compile and run my connect4View program but for some what reason I'm unable to do so. Below I have supplied the code for the 3 programs. …

Member Avatar for peter_budo
0
209
Member Avatar for nickwl23

Hi guys.. I am having some problem with snake game project using JAVA Applet. I already have the sour code of a snake game from my friends, but I failed to make it functions probably under a JApplet. I need to do a similiar UI like click a start button. …

Member Avatar for nickwl23
0
201
Member Avatar for BuhRock

Ok, I know most of you will read this and think I am a liar, but I am really just trying to practice with multiple classes and methods. So I picked out a programming challenge from my book to see if I could get through it. I wrote the class …

Member Avatar for vchandra
0
125
Member Avatar for c++student01

I keep getting NoClassDefFoundError so I cannot check if the rest of my program works. It works on the school computers but it does not at my house. I set up the path and classpath variables how my teacher told me for derby but it still will not work, any …

Member Avatar for vchandra
0
116
Member Avatar for lwschjang

Basically, I am having trouble figuring out how to work my if statements. The only one that works is the final statement and that is due to it not having the [CODE]if("#".equals(e.getActionCommand()))[/CODE] statement. So, how should I go about allowing the user to select the quantity in the combobox and …

Member Avatar for lwschjang
0
152
Member Avatar for softdev

Hi Guys, I am trying to create a game of a two way traffic with a human trying to move between the cars to the other side without being hit by a car. I can detect the collisions, but the main problem is my cars don't move. what maybe the …

Member Avatar for quuba
0
107
Member Avatar for FancyShoes

Hi I am trying to return a boolean value into another method, but it's not working. [CODE] public static boolean ItemFound(boolean item, String desc1, String desc2, JTextArea txt){ if(item == true) txt.setText(desc1); if(item == false){ txt.setText(desc2); item = true; } return item; }[/CODE] and inside the other method I have …

Member Avatar for FancyShoes
0
155
Member Avatar for neo_philiac

Hi, I got this piece of code from this forum and i was trying to modify it so that I can make it dynamic. I modified it a little bit to add multiple collapsible panels. But I need some help. 1. I need to add these panels dynamically. If I …

Member Avatar for moutanna
0
104
Member Avatar for grady-lad

Hi I am Making a horse racing application .... and the concept is when you enter a number in the textfield and select a horse(one of the 8 jButtons) the application will randomly select one of the JButtons and if the Jbutton is the same as the one selected by …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for cool_jatish

Hi......... Can u tell me SQL query to retrieve UNICODE Strings from the database................... Specifications........ 1] Language JAVA::: a) JAVA SWING applet b) JDBC-ODBC Bridge 2] Database a) MS Access b) Datatype :: TEXT Thanks in advance

Member Avatar for javaAddict
-1
79
Member Avatar for jaredleo999

Hi everyone, hope all is well I have a project which models an ATM machine. There needs to be an option in the welcome screen where the user has the option to set all of the numeric buttons in each class to a certain colour(red, blue or yellow). Because all …

Member Avatar for moutanna
0
86
Member Avatar for jemz

hello can you help me when i click the add button it will not add to the database.it will generate an error..can you help me please hoping for your positive responds...here's my code,please see my attachment.... [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.JPanel.*; import java.sql.*; public …

Member Avatar for jemz
0
210
Member Avatar for lwschjang

I'm pretty lost on this. I have no idea how to get my program to work. Basically, when an option is selected a price should show up in the text box automatically. Thank you all for your help. Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JComboBox cannot be cast to javax.swing.JTextField at …

Member Avatar for lwschjang
-1
4K
Member Avatar for Privoxy

Morning People I seem to be having a pretty big issue with a buffer I have that is reading a text file and acting upon the results of the file, As of now, the buffer reads each token in the file, and stores each token into a variable, this is …

Member Avatar for BestJewSinceJC
0
100
Member Avatar for grady-lad

Hi I am new to java and I am stuck on an assignemnt and im looking for some suggestions basically i have 8 buttons delcared as an array and i would like to double a number enetered in a textfield when clicking a certian button ..... i want each button …

Member Avatar for white feather
0
90
Member Avatar for mick18

Hi just wondering could anyone help me with this tic tac toe game i am developing it must be a GUI and include AI for the computer i originally made this tic tac toe game without the GUI but i am just having problems converting it to a GUI as …

0
50
Member Avatar for ibosstech

I am new to this place and have a lot of questions to discuss with all here. Starting with a problem that i am currently stuck in..:) I have a small project for which i am using net beans and want to generate the graph as I am having values …

Member Avatar for ibosstech
0
150
Member Avatar for blazinhieu

How can i make the program to tell the user what letter of the alphabet it is: ex: " k is the 11th letter in the alphabet" here is the code that i got so far [CODE]import javax.swing.*; public class Ncom{ String Inputnum; char num; public static void main(String[] args){ …

Member Avatar for mckrm
0
123
Member Avatar for skyzer

My every figure has centre point with coordinates x, y tips number radius which shows tip range from centre point. i have a drawingRule method which is for every shape i need to draw. [CODE]package business_logic; import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; @SuppressWarnings("serial") public class Vector extends JPanel { public …

0
71
Member Avatar for handrews3583

I'm working on a program in which I am using the BorderLayout Manager. However, I'm having a difficult time changing the size of the window. I want to make it longer and more narrow, with only one or two text fields per row and want to make the text field …

Member Avatar for Ezzaral
0
141
Member Avatar for acdougla17

I am trying to basically use the methods as functions and then call them in main but I cant figure it out. I thought it could be done like this but maybe I am just confusing my php&mysql class with Java. At the bottom of my code, there is a …

Member Avatar for stephen84s
0
169
Member Avatar for k2k

I had done a program with JFrame a year ago and I am trying to convert it to with JApplet so I can put it on the web. So far so good and I am able to see the applet and seems every functions are still working... there is one …

Member Avatar for k2k
0
198
Member Avatar for chrisb76

I am having problems setting up drop down menue for a application I am trying to do for a class. Can someone please give me some pointers. Here is the class assignment. Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage …

0
48
Member Avatar for rena0514

my previous button does go to the previous file: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; public class StudentAddress extends JPanel { private JButton submit, clear, next, display, previous; private JLabel first, last, street, town,state, zip; private JTextField fName, lName, hStreet,hTown,hState, hZip; private int studentCount=0, displayCount=0, i; //studentCount …

Member Avatar for moutanna
0
103
Member Avatar for mincus

Hi i have been trying to get a GUI in BlueJ working properly but i hav come across a prolem, i hav 2 buttons which i want to use but when i click them the actionListener wont run my methods. In the action preformed bit i tried to make it …

Member Avatar for llemes4011
0
143
Member Avatar for KSUliz

[code=java] import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; import java.util.*; public class Transfer extends JFrame implements ActionListener { //Declare output stream DataOutputStream output; //Construct a panel for the fields and buttons JPanel fieldPanel = new JPanel(); JPanel buttonPanel = new JPanel(); //Construct labels and text boxes JLabel …

Member Avatar for KSUliz
0
135
Member Avatar for johndoe444

In here: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html#general[/url] It says: The default content pane is a simple intermediate container that inherits from JComponent, and that uses a BorderLayout as its layout manager. In here: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/jcomponent.html[/url] It says: The JComponent class extends the Container class, which itself extends Component. This is contradictory, isn't it? Also what …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for laveena

Ihv writtten a prog of file searching and the result is to be displayed in table Im geting exception of stringindexoutofbound: String index out of range: -1 at java.lang.string.substring(unknown source) if i changed the path E:/ to e:/programs (program is some folder) then prog run correctly but i want to …

Member Avatar for laveena
0
166
Member Avatar for ganesh5155

Produce THREE buttons using SWING package. Each of the three buttons will react according to their respective tooltips. - Button A: set to Enabled and show the tooltip "Click this button to enable the Button C.” After this button is clicked, it should disable itself and Button B. - Button …

Member Avatar for stultuske
0
256
Member Avatar for chrisb76

I am having multible problems with my code. Here is what it is supposed to do: Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage, the term of the mortgage, …

Member Avatar for stultuske
0
102
Member Avatar for Gage84

Hi, I'm new to this forum I'm trying to allow my menu items to work by allowing a user to press it and then display a message such as 'door locks' etc and keep a progress that the door is locked or unlocked... pic below highlighted in red however with …

Member Avatar for Ezzaral
0
108
Member Avatar for Addi15

Hey Guys I was wondering if anyone could help me. I have to put pictures such as JPEG's into a swing program as part of an assignment. I've looked in textbooks and online but anything I find doesn't work. Can this be done cause I'm completely lost with it? Please …

Member Avatar for Ezzaral
0
61
Member Avatar for KSUliz

[code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import java.text.DecimalFormat; public class Grades extends JFrame { //construct components JLabel title = new JLabel("Grades"); JTextPane textPane = new JTextPane(); int numberOfGrades = 0; double total = 0; DecimalFormat twoDigits = new DecimalFormat ("##0.00"); //initialize data in arrays int[] grades = …

Member Avatar for moutanna
0
175
Member Avatar for chern4ever

need help, this is my code! [CODE]import javax.swing.JOptionPane; public class Lab2_1 { public static void main(String[] args) { int value1=0 ,value2=0 ,operator=0; String temp4="1"; while(temp4 != "0" ){ String temp1 = JOptionPane.showInputDialog(null,"Please enter first value."); value1=Integer.parseInt(temp1); String temp2 = JOptionPane.showInputDialog(null,"Please enter operator.(+,-,*,/)"); String temp3 = JOptionPane.showInputDialog(null,"Please enter second value."); value2=Integer.parseInt(temp3); …

Member Avatar for javaAddict
0
109
Member Avatar for bigbags911

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TicTacToeV1 implements ActionListener { /*Instance Variables*/ private JFrame window = new JFrame("Tic-Tac-Toe"); private JButton button1 = new JButton(""); private JButton button2 = new JButton(""); private JButton button3 = new JButton(""); private JButton button4 = new JButton(""); private JButton button5 = new JButton(""); …

Member Avatar for BestJewSinceJC
0
131
Member Avatar for falsedimitrii

I want to enable/disable a table cell based on the contents of another cell. e.g. if the reference cell value is "true", then enable the cell, otherwise disable the cell. I have set up isCellEditable() to do this and it works if the reference cell already has a value when …

Member Avatar for falsedimitrii
0
2K
Member Avatar for deraj8

I am trying to understand how draw graphics to the JPanel class but i have only been able to display one object at a time(unless i draw muiltiple shapes in my extended JPanel class but i dont want that!) [CODE]import java.awt.*; import javax.swing.*; /* Create a new graphics component that …

Member Avatar for mart@efun.ee
0
3K
Member Avatar for sohai

Now, I've just done a calculation program. What I need now is to build a [B]Semester[/B] class that will contain information about the list of subjects taken in a semester, the corresponding grades as well as the grade average for that semester. How should i build the class to store …

0
68
Member Avatar for Merosansar

The code for sleeping barber problem. When the status of the barber is set to busy then the customer cannot have a hair cut and is added to the waiting queue. when the customer is set to free then the customer have a hair cut. Here the problem is that …

0
70
Member Avatar for KSUliz

Hi Everyone. I am taking a class on java, and have made it to chapter 7 without many problems. I am having really bad problems with this, getting an illegal start of expression where it says public void sort....I have tried so many things, I probably even have things out …

Member Avatar for stultuske
0
643
Member Avatar for Colin454

Hi all I am enrolled in abeginners class and am having problems with methods. I keep getting a .class expected and do not know how to fix this. It is at this line that the message appears `total = Circle.area(int radius);`. import javax.swing.JOptionPane; public class Circle { public static void …

Member Avatar for Colin454
0
119
Member Avatar for drbrown3

Ok, using Jgrasp I was given a problem that asked me to design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are give in the following format....testscore1 weight1 This is what I have so far, the code will …

Member Avatar for masijade
0
462
Member Avatar for c++student01

This is a school project. I need to read jokes from multiple files and show them in separate threads. It complies but I keep getting IndexOutOfBoundsExceptions. Any tips or help you can give would be greatly appreciated. [code] import javax.swing.*; import java.awt.*; import java.io.File; import java.io.*; import java.io.FileNotFoundException; import java.awt.event.*; …

Member Avatar for vchandra
0
143
Member Avatar for marcel25

[code]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class tictac2b1 implements ActionListener { /*Instance Variables*/ private int[][] winCombinations = new int[][] { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, //horizontal wins {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, //virticle wins {0, 4, 8}, {2, 4, 6} //diagonal …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for Swingjohn

I have done a mortgage calculator program. it builds and run but I think tje GUI must be wrong because I cannot see it. I am very new to this and I am so lost. I do not know if this is the right forum. [code]import javax.swing.*; import java.awt.*; import …

Member Avatar for Swingjohn
0
226

The End.