32,204 Topics

Member Avatar for
Member Avatar for kandyhyatt

I'm having a hard time figuring out what i'm doing wrong. Can someone help ? this is the question : In the game of Craps, a "Pass Line" bet proceeds as follows. Using two six-sided dice, the first roll of the dice in a craps round is called the "Come …

Member Avatar for Ezzaral
0
103
Member Avatar for bmxbandit

Hello everyone, How do I use command line arguments from main(String[] args) as user input in java? My problem is that I need to make a program for an assignment. It needs to execute in 2 ways. If no arguments are entered, Ie. java myprogram it opens a menu that …

Member Avatar for NormR1
0
145
Member Avatar for fariya

environment variable1: %JAVA_HOME%\bin;%JC_HOME%\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar; environment variable2: C:\j2sdk1.4.1_07 hav 2 submit few progrms at college using servlets...n getting the errors mentioned abov...plzzzzzz hellllllppppppppp....

Member Avatar for peter_budo
0
106
Member Avatar for vskumar19

What is the difference between String s="abc" and String s=new String("abc");

Member Avatar for ~s.o.s~
0
74
Member Avatar for dangari

Hi all, I am working on a program that will take up Excel files, with columns in a certain order and with specific names, and load the data into a MySQL database table. This I have already achieved. [B]My challenge is how to have an email address where the Excel …

Member Avatar for dangari
0
147
Member Avatar for lockwater
Member Avatar for mitchneys

can anybody give me a code on how to put an image in a form. i am using a jreator 4.5. i dont know the code..please help me...tnx a lot..

Member Avatar for tong1
-1
82
Member Avatar for jems5

I would like to check user input value against a declared final variable to make sure it does not exceed the final int variable for the purpose of using in a try-catch-finally. [CODE] final int variable = 20; // Variable declared for max allowable int userInput = 0; // Used …

Member Avatar for jems5
0
106
Member Avatar for mitchneys

guys! can you help me convert this code to java language.... this is my code in c++....i need to convert in java.... # include <iostream.h> int num1,num2,sum; double add(double sum); int main() { cout<<"Enter first number"; cin>>num1; cout<<"Enter second number"; cin>>num2; sum=add(sum); cout<<"The sum is: "<< sum; return 0; } …

Member Avatar for mitchneys
0
135
Member Avatar for ANDIEniable

Hi Guys, i'm new to java and i need a code like a student form or employee on how to add, search, and delete a data in an array or list.. i'm very confused and i really need your help.. thanks.

Member Avatar for kvass
0
420
Member Avatar for plasticfood

[CODE]import java.util.Scanner; public class Highest{ public static void main (String [] args){ Scanner kb = new Scanner(System.in); int scores [] = new int[3]; String names [] = new String [3]; int highest = scores [0]; String names1 = names [0]; for (int i = 0; i<3; i++){ System.out.println("enter name and …

Member Avatar for NormR1
0
118
Member Avatar for ambikanair

HI All, I need to submit my feedback form contents to an e-mail id as soon as the user clicks the submit button. How will I implement this in java. I googled and found out that FormToEmail which is a php script does this. But since i Am using netbeans, …

Member Avatar for ambikanair
0
111
Member Avatar for eman 22

I have a problem when I make GUI using SWT. the ptoblem is I want to remove all component except one from the shell at specific event.but I'm not preffered to use setVisible(false) because the big numer of component which will remove . how can I do that?

0
51
Member Avatar for flyingcurry

I have a prime number method here which checks if the user input is a prime number, I've done some stuff to try to make it more efficient, but I am wondering if there is anything else that can be done, maybe even make the complexity class constant? Thanks. Below …

0
108
Member Avatar for xterradaniel

EDIT: Never mind I figured out what to do to get the results I wanted. It came to me less than a minute after finishing my post. Thanks anyway... Hello all, I wrote the required program that I must turn in tomorrow. However I have one hangup, I am supposed …

0
83
Member Avatar for andyluvskrissy

[code] import java.util.*; import java.text.*; import javax.swing.*; class Lab4Part2{ public static void main (String[] args) { String ex1; Double num, F; final int a=0, b=0; JFrame myWindow=new JFrame(); myWindow.setSize(500,400); myWindow.setTitle("Calculator"); myWindow.setVisible(true); myWindow.setLocation(600,200); ex1=JOptionPane.showInputDialog(myWindow, "Enter an expression"); F=Double.parseDouble(ex1); num=(a+b); JOptionPane.showMessageDialog(myWindow, "The sum is "+num); } } [/code] I need some help …

Member Avatar for NormR1
0
178
Member Avatar for jems5

My program requires that the user input values for an array do not exceed a declared final int variable. To control this I wrote this code to catch and throw exceptions in order to prevent computer from crashing the program. There are two conditions to be handled. (1) Exceeding array …

Member Avatar for dangari
0
143
Member Avatar for tonyfingures

Hey! guys, i need help figurering out how to make this program ran. Jack has decided his student organization is going to sell Oktoberfest shirts at Oktoberfest. In order to compete with other clubs, he wants to offer a 10% discount to anyone who buys 5 or more shirts. Also, …

Member Avatar for JamesCherrill
0
162
Member Avatar for dorotalp91

Write a program that generates a pyramid of numbers from a users input (kbReader = new Scanner(System.in)) for example the number 5 is inputted and the wats printed is... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 help?

Member Avatar for cazio_)15
0
142
Member Avatar for gauravk_bhanot

This is the code of my key listener for a game.The keys move a plank upwards and downwards for two players.The problem is when one player keeps a key pressed then the other key event does not execute.what i want to do is that both players should be able to …

Member Avatar for NormR1
0
192
Member Avatar for nwalser

Ok so to give you a brief summary of whats going on our original assignment was to make a password directory that adds, saves, looks up, and removes a name and password that are connected together in an array. So now we need to alter the code so it works …

Member Avatar for NormR1
0
296
Member Avatar for nickoooname

Hey guys, im getting a null pointer exception... but i dont know what is wrong. Im trying to get data from a hashmap, and place it in a swing tabel. [CODE=java] ArrayList planes_array[] = null; //planes_array[0] = new ArrayList(); for(int i=0; i<planes.size(); i++) { ArrayList tmp_array = new ArrayList(); tmp_array.add("1"); …

Member Avatar for JamesCherrill
0
139
Member Avatar for noydoy

[CODE]import javax.swing.*; import java.text.*; public class Postage3{ public static void main(String args[]){ double weight, cost, count; int choice, choice2; DecimalFormat df = new DecimalFormat ("0.00"); choice2 = 1; while(choice2 == 1){ weight = Double.parseDouble(JOptionPane.showInputDialog("Enter weight of postage according to ounces")); if(weight <= 1){ cost = weight * 0.30; } else{ …

Member Avatar for noydoy
0
2K
Member Avatar for Dean_Grobler

Hi there, I've just switched to Eclipse. I've been using TextPad so Eclipse is pretty cool.. But I've been getting weird error messages that I don't understand/not used to. Here they are: [CODE]JButton btnEnter = new JButton("Enter"); btnEnter.addActionListener(this);[/CODE] Here the Error says: Multiple markers at this line. -Syntax on token …

Member Avatar for Dean_Grobler
0
198
Member Avatar for ncstplaya1234

[CODE]import java.util.*; public class DiscountBolts { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); double bolts, nuts, washers; double total; System.out.println("Enter number of bolts: "); bolts = keyboard.nextDouble(); System.out.println("Enter number of nuts: "); nuts = keyboard.nextDouble(); System.out.println("Enter number of washers: "); washers = keyboard.nextDouble(); total = (bolts …

Member Avatar for dangari
0
149
Member Avatar for islam-morad

Hello guys, i'm studying the Java programming language. every thins were going very well, but once i have encountered RECURSION i started to feel so bad. there is a recursive method that is blowing my mind. I can't figure out how does it print that the sum of a set …

Member Avatar for islam-morad
0
129
Member Avatar for shinnie

i'm writing a Java program that ask the user to input words using JOptionPane.showInputDialog() Then look at each letter in the word and add up the points for each letter. Vowels (a,e,i,o and u) are valued at zero.The letters "x" and "q' are valued at 5.All other are 1.Anything not …

Member Avatar for JamesCherrill
0
218
Member Avatar for marketingmaniac

The unfollow button is written in Java does anyone or can anyone programmaticly click the unfollow button? tried everything i know, visual basic, Java, JavaScript,, you name it,, cant do it.

Member Avatar for peter_budo
0
63
Member Avatar for Polvos Elvira G

good morning i would like to ask about photo gallery codes in java...thank you...

Member Avatar for peter_budo
0
50
Member Avatar for GooeyG

An account has the properties account number, balance, annual,interest rate, and date created, and methods to deposit and withdraw.Create two sub classes for checkings and savings account.Checkings account has an overdraft limit, but a savings account cannot be overdrawn. One problem that i'm having is that when I withdraw x …

Member Avatar for JamesCherrill
0
12K

The End.