Alright...
this is not a programming question per se just yet. I am embarking on my first ever real programming project. My uncle wants me to build my own (or find a way to incorporate many...
Type: Posts; User: that_guy
Alright...
this is not a programming question per se just yet. I am embarking on my first ever real programming project. My uncle wants me to build my own (or find a way to incorporate many...
Trouble = the entire ActionEvent for which this post originates.
I changed the call to this:
ActionEvent e = new ActionEvent(this, 1001, null);
MainGame.grid[toClaim].actionPerformed(e);
...
thats what I am trying to do. My problem is that I do not know how to successfully create an actionevent object. Here is the calling code:
public void begin()
{
while(true)
{...
Hey all,
First off, I like to create my own algorithms, its good practice.
So I am making a simple Tic Tac Toe game and everything works perfectly except...
When it is the computers turn I...
I don't get it, why isn't it a T?
I am learning generics in my Data Structures class and during the reading I fully understand it but when it comes for me to write my own code and imlement it via a project or assignment, it takes me...
This is what I changed it to and it worked:
do
{
if(done != null)
list.add(Integer.parseInt(done));
if(scan.hasNextInt() || scan.hasNext("done"))
done = scan.nextLine();
else
I am trying to determine if the user did not input a correct value without throwing an exception.
I have a String variable, done, which stores the user input and then if it is not storing "done"...
I liked
Introduction to JAVA programming, Eigth Edition
by: Y. Daniel Liang
Hey man. Norm has been doing a great job with helping you.
With the constructors, you are using what is known as method overloading. You are creating multiple constructors within the same class....
sounds like it might work. how would I implement it?
Literally I want the user to enter a color like red. Since red is a java recognized color I want the program to convert the string into a color and then find the hexadecimal of that color so I can...
I am trying to figure out how to get the hexadecimal value from a RGB.
This is a snippet of my code:
//where a is the user inputed string of a color, i.e. "red"
//and where hex is a...
ok got it...
instead of
Welcome.setText("Welcome " + Field2 + " " + Field1);
I should have had:
Welcome.setText("Welcome " + Field2.getText() + " " + Field1.getText());
Ok so I want the user to enter their name and age and when they press a JButton the program sends a welcome message to the user "Welcome first name last name"
here is my code:
import...
how so? should I do grid layout and just add (I think) 64 squares of black or brown and white? Secondly would I implement an actionListener to this or would I do that for the pieces class?
Hey,
I am trying to make a chess game (just two players, no computer player just yet) and dont really know where to start. I was thinking a main class to call the other classes, a board class to...
I would say add an if statement right before the end of the do-while loop.
if(loop == 9)
{
System.out.println("Do you want to go again?\nYes or No";
Scanner scan = new...
Yes, what Norm said. Your program expects you to enter all 3 of the names first then all three of the scores.
your program wants the following input:
Smith
Jones
Peterson
70
30
100
First of all your program doesnt ask for user input when inputing the students names and scores. It just expects the user to know what the program wants.
Your first for loop in decreasingOrder()...
Ok, well it would only read or write once every time the program is run. The program would kind of be like a log. You know, like "this happened on this date at this time". So if it were all one file...
Hey, been a long time since I've been on here. Been a long time (I'd say 8 months) since I've truly dealt with java. Before I briefly stopped with it, I never truly grasped file I/O.
so, whats the...
btw, which borderlayout tutorial are you talking about? there was no link posted with the recommendation, so how would you go around the drawString situation?
hmmmm......
how about try changing your for loops:
for(int i=0;i<4;i++){
for(int j=0;i<4;j++){
a[i][j] = mad.nextInt();
}
}
hahahaha now its worse (or so i think)...
i changed the labels to Jlabels which created errors cause apparently jlabels dont have the setAlignment() method so i changed those method calls to...