32,199 Topics

Member Avatar for
Member Avatar for Raven50

[CODE] import java.text.NumberFormat; import java.util.Locale; import java.util.Scanner; class Television { private String itemNumber; private String productName; private double unitPrice; private double unitPrice; //constructor public Television (String itemNumber, String productName, double units, double unitPrice) { setItemNumber(itemNumber); setProductName(productName); setUnitPrice(unitPrice); } //accessor methods for class variables public String getItemNumber () { return itemNumber; …

Member Avatar for jwenting
-1
237
Member Avatar for coalman987

Hi all I'm new and I'm horrible at Java. I've written this decryption code for a Caesar cipher but now I need to decrypt a one-time pad. Is there any way to simply work with what I have and rewrite it to work with a one-time pad? Or must I …

Member Avatar for jwenting
0
675
Member Avatar for sirlink99

I am trying to sense multiple keys at a time and I am wondering how to use a hash map to do this.

Member Avatar for mKorbel
0
144
Member Avatar for bangor_boy

Hi, I am bit stuck here, I have to have edit this code so that a train must wait in front of the tunnel lock for a train to come in the opposite direction to exit before it can enter the tunnel, i have to use java built in synchronisation …

Member Avatar for mKorbel
0
96
Member Avatar for SolidSora

I got an image called badguy and it will not draw in the applet. Here is my code below. [CODE]package mainpackage; import java.applet.Applet; import java.applet.AudioClip; import java.awt.Graphics; import java.awt.Image; public class Test3 extends Applet implements Runnable{ /** * */ private static final long serialVersionUID = 1L; AudioClip shot; Image badguy; …

Member Avatar for mKorbel
0
147
Member Avatar for soft_coder

Hi! I am a .NET developer. I have added a Java WSDL as a web reference to an application. After someday I deleted the reference and added it again. From that day I am unable to build/debug/deploy the solution. I am getting the following error: [B]Custom tool error: Unable to …

0
54
Member Avatar for hellkosmos

hi guys actually i been searching the net for the past days on how to put a background /and or image in apache-tomcat-6.0.29 can you check if something is wrong with my code? i mean if i wanted to put something like .jpg where should i put it in my …

Member Avatar for ztini
0
128
Member Avatar for khwabincod3

Hello, I am a beginner to java and needed some assistance...I am writing code to create my own singly linked list, and an iterator that iterates over the elements of the list...however I don't know how to use the iterator to display the elements of the list and I am …

Member Avatar for ztini
0
248
Member Avatar for sj5536

hi i want to add Scroll Pane to JTable [CODE]JScrollPane jScrollPane = new JScrollPane(table); jScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); add(jScrollPane,BorderLayout.CENTER);[/CODE] in the above code table is and Object of JTable with default model i write above code but that code display the scrollbar but they dont work

Member Avatar for sj5536
0
90
Member Avatar for tracydo

Reviewed with answer from my quiz, I want to make sure that I understand it right? If not, what is yours? int x=1; int j; for(j=0; j<=2; j++) x=x*j; System.out.print(x); --------------------- answer is x=0 My understanding is since this for loop has no curly bracket, therefore, no loop after the …

Member Avatar for jokers6
0
120
Member Avatar for charchar88

This game is like the game scramble that you play on facebook. Also similar to boggle. Basically you input the dimension of the grid of letters that you want and the dictionary.txt file and it will print you all the words found. It's suppose to find words in all directions …

Member Avatar for nezachem
0
213
Member Avatar for Kuroshi

I want to learn how to connect computers so I created a game for 2 players that was played on the same computer, now I want it to be played on a network. I have been trying to do this with sockets. I have a server class: [CODE]public class WordsGameServer …

0
95
Member Avatar for hany-h

Hi guys, I have a class (DrawPanel) which extends Jpanel.This class generates random shapes (lines,recangles and ovals) . I am suppose to add a statusbar to this class but I can't add even a simple lable to this panel... I am so frustrated and would be so appreciate if anyone …

Member Avatar for JamesCherrill
0
151
Member Avatar for vextorspace

when I try to run a java program on my mac or linux box with the <code> java -version:1.6+ -jar jdesigner.jar </code> it tells me there is no jre found meeting the requirements even though when I type <code> java -version </code> it tells me the version is 1.6.0_20 or …

Member Avatar for vextorspace
0
177
Member Avatar for sciprog1

Hello Members, The following code compiles and runs accurately, but gives the following message: [CODE]Note: List.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.[/CODE] [CODE]import java.util.*; public class List { private final static int[] array = {1,2,3,4,5,6,7,8,9,10,11,12,56}; public static void main(String args []) { ArrayList x = …

Member Avatar for sciprog1
0
129
Member Avatar for blackhook

my problem is i cant get the overall numeric score and the grade letter import java.io.*; import java.util.Scanner; public class GradePrg { BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); int quiz1, quiz2, quiz3; float tMidTerm, tFinal, tQuiz; int midTermExam = 0; int finalExam = 0; float finalScore= 0; String name; char …

Member Avatar for jon.kiparsky
0
244
Member Avatar for tracydo

I spent so much time from scratch to finish and to the point that I couldn't figured out what is all my mistakes about. I need a fresh set of eye, may you help? (errors at the bottom, sorry for have to scroll down the long page) Thanx [code]/* *Description: …

Member Avatar for tracydo
0
3K
Member Avatar for thes0mething

Hello everyone on Daniweb!:) I'm all new with working with swing and I'm having some problems making my paint method work:/. Atm I'm just tryin to make it write a ball, which I can control into different directions. Right now there is quite alot of unnecessary stuff in my code …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Omargeek

I get this error and i don't know what is wrong i declared a new class and initialized it yet the compiler still gives me the error above. public class Vec { private double[] v; public Vec(int length) { double[] v= new double[length]; for(int i=0;i<length;i++) { v[i] = 0.0;} } …

Member Avatar for hanvyj
0
362
Member Avatar for sharathg.satya

can anyone say how to use java in windows 7 I installed it but its not working. i am unable to compile a java program. please help me in solving this problem. i am getting this message in command problem when i use javac "'javac' is not recognized as an …

Member Avatar for jwenting
0
124
Member Avatar for yancouto

I'm creating a silly game, and the first thing I want to make is to tell you "You Lose" if the all that you control with the mouse is not inside the frame. I created a JComponent and every 20 milliseconds it is repainted (A thread does that). Inside it, …

Member Avatar for hanvyj
0
1K
Member Avatar for recees_mum

This code has gven me more problems than it is probably worth. Can anyone help me please? [CODE]package payrollprogram2; import java.util.Scanner; public class PayrollProgram2 { //begin class public static void main(String[] args) { //begin main System.out.println("Welcome to the Payroll Program"); //output Welcome to the Payroll Program Scanner input = new …

Member Avatar for JamesCherrill
0
134
Member Avatar for AhmedGhazey

peace be upon with you I have a problem i wanna a pseudo code for edge assembly recombination(crossover) . I searched for long time and I couldn't find any good paper satisfy my need. plz if you have a clear one don't hesitate contact me or post the link thanks …

Member Avatar for JamesCherrill
0
59
Member Avatar for reet_bahl
Member Avatar for ayanbizz

How to start building mobile appliacations using J2ME platform.Can somebody suggest me any book for beginners from where I can start learning about it?

Member Avatar for peter_budo
0
128
Member Avatar for techie929

Hi, I have to create a tree for Minimax algorithm upto depth d. I am not getting how to create.Could anyone please suggest me a method? Thanks.

Member Avatar for qlipboard
0
74
Member Avatar for recees_mum
Member Avatar for jwenting
-1
24
Member Avatar for kasraluckblack
Member Avatar for jwenting
0
68
Member Avatar for cretaros
Member Avatar for masijade
0
63
Member Avatar for stephenk291

Any help with this would be appreciated. Basically I need to setup a function that will track both the getUserChoice/GetCompChoice scores for each of the 10 Games, however lets say out of 8/10 games the user has won 6 so therefore the user cannot come back to win the most …

Member Avatar for VernonDozier
0
1K

The End.