Help coderanch get a
new server
by contributing to the fundraiser

deb uebersetzig

Greenhorn
+ Follow
since Sep 29, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by deb uebersetzig

my applet is always saying access denied....what is wrong....
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Password extends Applet implements ActionListener
{
Label password = new Label("Enter your password");
TextField answer = new TextField("", 10);
public void init()
{
add(password);
add(answer);
answer.addActionListener(this);
answer.requestFocus();
}
public void actionPerformed(ActionEvent e)
{
String reply = answer.getText();
Label theOK = new Label("");
if(reply == "Rosebud")
{
theOK.setText("Access Granted");
add(theOK);
remove(answer);
invalidate();
validate();
}
else if(reply != "Rosebud")
{
theOK.setText("Access Denied");
add(theOK);
remove(answer);
invalidate();
validate();
}
}
}
23 years ago
I am trying to print a value from the table,I am not coverting my Char and I can't get a clean compile...what am I doing wrong?
public class Schedule
{
public static void main(String[] args) throws Exception
{
String[][] id =
{ {"CIS 115 Th 1:30"},
{"CIS 120 Mo 10:30"},
{"CIS 125 We 9:30"},
{"CIS 130 Mo 8:30"} };

char course;
int x, y, courseId;
System.out.print("Enter course ID-number 0-3, ");
course = (char)System.in.read();
for(x = 0; x < 4; ++x)
for(y = 0; y < 1; ++y)
courseId = Character.getNumericValue(course);
if(courseId == id[x][y])
System.out.println("The course name, day and time are " + id[x][y]);
}
}
23 years ago
public class ReasonJava
{
public static void main(String[] args) throws Exception
{
String[] inputNumber = {"It's fun", "It's new", "It's easy",
"It's exciting", "It's different", "It's wild", "It's cool",
"It's gonna help me get a job", "It's something my hubby doesn't know",
"It's out there"};
String inputString = new String();
char inputChoice;
int inputNum = 0;
System.out.println("Enter why you like Java..pick number 0 - 9: ");
inputChoice = (char)System.in.read();
System.in.read();
System.out.println("You have chosen " + inputChoice);

inputNum = Integer.parseInt(inputNumber);
System.out.println("this is inputNums value " + inputNum);
-----this is my code...and the problem is at the Integer.parseInt----it points to the dot between the two words.......Am I doing it wrong???

23 years ago
I am working on a problem for school that has a string of the top ten reasons for something. Then you prompt the user to enter
either 0 - 9 as their choice of the reasons. I am supposed to convert the number to an integer and then use the integer to print the reason chosen. I am stuck on trying to convert the Char from the prompt to an int....what class should I be using or is there a better way to approach this........
23 years ago
Thanks Carl - I didn't do anything with notepad...nothing unusual when I created the class....so I copied my code into another newly named member....changed the name within and it worked fine......something was definitely wrong.....but it worked and I am HAPPY!!!
23 years ago
when I compiled my UseEmployeeWithDate program, I got this error
error: cannot read
UseEmployeeWithDate.java
I don't see anything different with this program than any other ones....could someone help me with what is going on and why it cant read it.....
23 years ago