server_crash 64 Postaholic

It's prefence. As long a you have an String array as the argument, it can have any name, and be "formatted" anyway.

public static void main(String[] args)
public static void main(String args[])
public static void main(String[] s)
public static void main(String s[])


All of those are perfectly legal. Actually as long as it's public, static, void, named main, and as a String[] as a parameter, This is even legal:

static public void main(String[] args)


So basicly it comes down to personal preference.

server_crash 64 Postaholic

Take just this simple method from the graphics class: fillOval()....Why is it abstract? Or better yet, where does it become concrete? I know I've never had to create my own implementation of that method.

server_crash 64 Postaholic

Or has France switched to the Euro?

server_crash 64 Postaholic

What is a terrorist country, and how do you kill it?

Most middle eastern countries. You kill them the same way they are killing other people. :rolleyes: I would use nukes, but I'm not the president...But really they should start bombing the religious mosques and stuff.

server_crash 64 Postaholic

I don't think you want JTextFields. Look up JOptionPanes. They give you many options to get input from the user via an input box.

Rashakil Fol commented: That's an answer! +8
server_crash 64 Postaholic

pffffff..He's so tall he can't fight. I'm saying someone beat the crap out of burtuzzi.

server_crash 64 Postaholic

I hope they kill him, his buddies, and all these terrorist countries.

server_crash 64 Postaholic

Let's hope they didn't put a retriction on fighting. I'm ready to see some bloooood.

server_crash 64 Postaholic

I wonder if they people who actually came up with this believe it? This sort of reminds me of the crap people came up with during the assination of JFK. I mean, some were logical, but a few were close to saying there was an alien hiding in the bush. I bet some people believed this who read it. Just like the time in California when some guy said aliens were coming to get them, so a bunch killed themselves.

server_crash 64 Postaholic

Another way would be using a bufferedreader to get input from the user. But why not jut compile with the correct arguments? You know how to do that right?

javac ProgramName.java

java ProgramName argument1

server_crash 64 Postaholic

100,000 dollar reward is offered for anyone who can email evidence to them? I'm taking a picture tonight and sending it in.

server_crash 64 Postaholic
server_crash 64 Postaholic

He's seeing double because he's staring at objects too long. I have the same problem, but it's PERFECTLY normal(at least that's what the doctor said)..

Now, if he's can't see things far away, get to a doctor. My perscription is 20/500....Now, unless he wants to have eyes that bad, he better get to a doctor right now!

server_crash 64 Postaholic

Why not start with a simple example that uses nothing but the command line.

class test
{
   public static void main(String[] args)
   {
        int grade1 = Integer.parseInt(args[0]);
        int grade2 = Integer.parseInt(args[1]);
        int average = (grade1+grade2)/2;
        System.out.println("average --> " + average);
   }
}

That will give you some experience with command line args. You could also use a BufferedReader to read input rather than arguments, and practice with "if" statements in deciding what letter grade.

server_crash 64 Postaholic

That means it couldn't find the destination. I noticed you are using command line args. Do you know how to get those? It won't run unless you have an argument to the right destination.

server_crash 64 Postaholic

I'm curious as to how it lays the code out for you. Does it still follow the right form in which you want? I remember when I was like 12 and "trying" to learn VB.NET(failed miserably), I thought that was the coolest thing in the world that I had to do basicly no programming except for a few lines in methods generated for me, then show off the crappy programs to my parents. Now, I would rather do it myself rather than trying to learn how to work the programs and stuff like that. But I really enjoy using the command line. At least for now!

server_crash 64 Postaholic

I don't even know how to begin!!!

Or do you not want to begin? :eek:

server_crash 64 Postaholic

There's no use; these lazy turds won't change, and won't ever know that JEdit owns all IDE's.

server_crash 64 Postaholic

THANK YOU so much. I would have never spotted or known what was happening.

Thanks for helping.

server_crash 64 Postaholic

I know, that's what I don't understand. It' almost like it's refreshing the page or something. Here's the code I've got. I know the thing looks really ugly but I'm a beginner at JavaScript:

<html><head>
		<title>JavaScript Calculator</title>	
		<script language="JavaScript" type="text/javascript">
			function display(number)
			{
				var x = document.form1.displayText;
				x.value = number;
			}
		</script>
      </head>
      <body>
        <form name="form1">
      	<table>
		<tr>
			<input type="text" name="displayText" size="30">
		</tr>
		<tr>
			<td><input type="submit" value="7" name="button7"
			     onClick="display('7')"></td>
			<td><input type="submit" value="8" name="button8"
			     onClick="display(8)"></td>
			<td><input type="submit" value="9" name="button9"
			     onClick="display(9)"></td>
			<td><input type="submit" value="/" name="buttonDivide"></td>
			<td><input type="submit" value="sqrt" name="buttonRoot"></td>
		</tr>
		<tr>
			<td><input type="submit" value="4" name="button4"
				onClick="display(4)"></td>
			<td><input type="submit" value="5" name="button5"
				onClick="display(5)"></td>
			<td><input type="submit" value="6" name="button6"
				onClick="display(6)"></td>
			<td><input type="submit" value="*" name="buttonMultiply"></td>
			<td><input type="submit" value="^2" name="buttonSquare"></td>
		</tr>
		<tr>
			<td><input type="submit" value="1" name="button1"
				onClick="display(1)"></td>
			<td><input type="submit" value="2" name="button2"
				onClick="display(2)"></td>
			<td><input type="submit" value="3" name="button3"
				onClick="display(3)"></td>
			<td><input type="submit" value="-" name="buttonMinus"></td>
			<td><input type="submit" value="1/x" name="buttonOneX"></td>
		</tr>
		<tr>
			<td><input type="submit" value="0" name="button0"
				onClick="display(0)"></td>
			<td><input type="submit" value="." name="buttonPeriod"></td>
			<td><input type="submit" value="+/-" name="buttonPlusOrMinus"></td>
			<td><input type="submit" value="+" name="buttonPlus"></td>
			<td><input type="submit" value="=" name="buttonEquals"></td>
		</tr>
	</table>
	</form>
     </body>
server_crash 64 Postaholic

I'm trying to make a simple calculator and whenever I want to add text to the textfield(say a number) it will show up, then will dissapear.

function display(number)
			{
				var x = document.form1.displayText;
				x.value = number;
			}

This is how I'm doing it, but why is the text dissapearing right after it appears?
Note: This method is called whenever one of the number buttons is clicked.

server_crash 64 Postaholic

If I didn't get it all, let me know.

freesoft_2000 commented: Thanks For The Help +2
server_crash 64 Postaholic

It's the same thing except change the s to an r.

shutdown -r -t 00

server_crash 64 Postaholic

You have to override all the keylistener methods:

public void keyTyped(KeyEvent key) 
	 {
	      
	 }
	 public void keyPressed(KeyEvent ke) 
	 {
	      
	 }
	 public void keyReleased(KeyEvent key) 
	 {
         }
server_crash 64 Postaholic

import java.io.*;

server_crash 64 Postaholic

Just in case, here's kindof what he's talking about:

public class Card
{
	private int [] rank= new int [13];
	private String [] suit={"Spades","Hearts","Diamonds","Clubs"}; //Not used?


	public Card()
	{
		super();
	}
	


	public void setRanks(int []rank)
	{
		for (int i=1;i<=13;i++)
		{
			rank[i]=i;
		}
	}


	public int getRankAt(int index)
	{
		return this.rank[index];
	}
}


class TestCard
{
	public static void main(String[] args)
	{
		[B]Card c = new Card();
		System.out.println(c.getRankAt(11) + "");[/B]
	}
}
server_crash 64 Postaholic

Well, this isn't my DB. It's the hospitals that I work at. I'm wondering since access is limited to only 5 connections if that could be the cause to some of the problems it's having, or if it could be the access "programmer"(as they call him). The database is not registering changes untill the second time, but I'm not sure how many people other than me have access to it. It is on a novell workspace, so that is questionable. I wish there was a way I could find out how many connections are actually made to it.

server_crash 64 Postaholic

The best way is to add one to the end. You don't need the round method; A better choice would be the Math.ceil() method since it rounds up.


int i=(int)(101+((int)100*Math.random()));

or


int i=(int)(100+((int)101*Math.random()));

or


int i=(int)(100+((int)100*Math.random()))+1; //My choice

server_crash 64 Postaholic

It's possible, but I'm not 100% sure.

I believe you can it's just you must recall the paintComponent() method in the run method:

g2D.drawLine((fnx1) + 80, (fny1) + 80, (fnx) + 80, (fny) + 80);

this.paintComponent(g2D);

Since the paintComponent is expecting a graphics object, i believe you MIGHT run into trouble with passing it a graphics2d object.

server_crash 64 Postaholic

How are you compiling this??

are you using the form:

javac ProjectName.java


to run

java ProjectName


Have you changed your CLASSPATH variable?

server_crash 64 Postaholic

Maybe this will work:

Process p = Runtime.Runtime().exec("ipconfig");

server_crash 64 Postaholic

There is one sure way of knowing: USB 2.0 was introduced in 2001, so if you bought it before then, you don't have 2. You could check the device manager and see if your controllers are enhanced, if so, they're 2.0..If not, buy a PCI card for hardly no money....That is, if you have a desktop.

server_crash 64 Postaholic

Take this situation: A Hospital Database containing information on over 800 employees. Which database software would you use? Is Access just as good as mysql?

server_crash 64 Postaholic

Serial, I loved the way you used the properties for the gridbaglayout on each button. That's what helped me out. I've known Java for a year and am very good at it, but I've never used the gridbaglayout and to tell you the truth, the code you showed me really helped out.

server_crash 64 Postaholic

I'm a little confused here. Lets say this is an upload page were the user enters the path or clicks the browse button, whichever he/she prefers. How exactly do you get that file off their computer since there is so many restrictions with java?

server_crash 64 Postaholic

Yeah, his backup golie actually did better the past season...I think his name was prusek??

server_crash 64 Postaholic

The best advice is to wait for the right one. If you get desperate and will go for anyone, then that can lead to disaster later in life. Don't just go for the first person you see, get to know them a little.

server_crash 64 Postaholic

Hasek sucks. It was a mistake to get rid of lalime, although he was having a terrible year. Hasek just rolls around on the ground and it pisses me off. Anyways, the Rangers will probably lose a few of their players, Messier being one of them possibly to retirement. I feel sorry for my crappy team "Carolina Hurricanes" because they were having trouble even before the lockout! But I really don't care about Carolina; I personally like anaheim because my favorite player is there(fedorov).

server_crash 64 Postaholic

Okay, that makes more sense. So basicly it comes down to the popups "blowing up" in the users face, which I've always tried to avoid. I guess you could have both validations as an option to suit both sides of things. Thanks for the help.

server_crash 64 Postaholic

Crap, I was hoping that wasn't the case. I think something is wrong too. It NEVER did this in the start, but the computer just ran out of warranty about a month ago. I know the dell people are nice because they've already replaced a bad screen on this baby.

server_crash 64 Postaholic

I finished the calculator with added scientific buttons, but it doesn't have operator presidence. This is one thing I'm working on right now. I'll send you the calc via PM if I ever finish it to let you see what I got.

server_crash 64 Postaholic

Maybe I don't understand the context. Wouldn't it be better in many ways to have a browse button(say the user wants to upload something) even if he/she does know the URL?

server_crash 64 Postaholic

Basicly it comes down to creating a formula to convert your coordinates into screen coordinates.

server_crash 64 Postaholic

why would you allow the user to enter the path anyway?(not that it's a bad thing) Why can't you use a file browser?

server_crash 64 Postaholic

WOoaoooasdflkaslkjas;dflaskjfa;sldkjf

The hockey people just closed a deal :cheesy: :cheesy: :cheesy: :cheesy:

My beloved sport is back. I'm so happy, one year is too long.

server_crash 64 Postaholic

That means there is no method matching the signature you gave. It could be a parameter missing, a mispelling, or a number of problems.

udit,
you forget the t in paint:

public void pain(Graphics g)

change to;

public void paint(Graphics g)

server_crash 64 Postaholic

That is EXCELLENT for a beginner. The example you gave really helped me out because I just could not figure it out. So, thank you very much.
I personally would much rather use the setBounds() method which gives you more freedom(in my opinion) and is much easier to use.

As for your question:

Yes you can use button arrays(if that's what you were asking). I guess you looked at my code. At first I was trying to use arrays but I don't think that's the best way to go using the gridbaglayout.

Good resources:

java.sun.com has the best tutorials.
javaalmanac.com has some really good stuff.

I think searching google is the most helpful. I personally don't like going to one site and looking around for a tutorial. Just search google for what you want to know, and I gurantee you, you will find great resources that way. One more thing, posting in forums are very helpful. If you ever have any questions or need anything, just post and I will see what I can do. If you will be more specific as to what you need, I can look for some resources for you.

server_crash 64 Postaholic

Ok, I finally figured it out. It's not as hard as it looks. Thrilla, I'll help you out, but I'm really busy at the moment so just give me a little while and I'll see what I can do.

server_crash 64 Postaholic

Are you using the BlackBerry java sdk? That would be the start. I've never used it so I can't help you with the methods, but I do know the api methods you will be using are different. I'll look around and see if I can't find anything.

server_crash 64 Postaholic

Thanks man, but I'm still have tons of problems with this. I'll attach the code that I have, please see if you can at least help me get this thing started. By the way, this is NOT homework. I'm just trying to learn the gridbag layout while making a calculator but can't get this thing going.