tools.jar doesn't need to be (in fact shouldn't be) on the classpath.
Really? I've never been tought different, nor known different...Could you explain?
tools.jar doesn't need to be (in fact shouldn't be) on the classpath.
Really? I've never been tought different, nor known different...Could you explain?
Your welcome, and glad you got it fixed.
You'll have to explain the 1st question a little more.
One the second question, if you are using a JTextField to display data, you can set the horizontal alignment.
textField.setHorizontalAlignment(JTextField.CENTER);
or .RIGHT
or .LEFT
or .LEADING
or .TRAILING
Your classpath is wrong. It should point to the tools.jar file in your jdk directory. When you do this MAKE SURE that you add a period to the end of tools.jar like so:
tools.jar.
And I am asking Congress to outlaw all copy protection schemes.
Good luck. You'll need better reason than a lost key, but of course individuals are able to change the constitution these days, so there's no telling what you can do.
Anyways, I agree to some extent, but there needs to be some kind of protection. M$, and other companies use a good scheme of simply using a product registration key, which doesn't really protect much...I guess they realize that someway or another it's going to happen, so theres no use in investing in schemes such as securom or safedisc.
You should have let me know that it still wasn't working. These problems can take a while to fix.
Now, if you tried putting the period at the end of the .jar extension(.jar.) and it didn't work, try adding this at the VERY beginninng:
.;%classpath%.;
WOW! I would have NEVER spoted that. I was thinking since it ran at runtime with only one row that it never updated the count. Thank you so much; I was banging my head against the wall on this one...I wish I could give you a big hug for that. :lol:
Looks good to me. I like how you have recommended books with your topics.
It's probably looking for the classes to be packaged in a jar file instead of your current configuration..I could be wrong about that, but I'm thinking that's what it is. Why don't you post the FULL error message or grab a screen shot of it.
I know that you can call this method to delete a row from a JTable:
DefaultTableModel.deleteRow(index);
I need to delete all of the rows at some point, and this is not working:
for (int i=0; i<dtm.getRowCount(); i++)
{
dtm.removeRow(i);
mortgageTable.revalidate();
}
I tried revalidating, but that didn't work. This only deletes the last row. Now, at runtime the table consists of only one row and later many rows are added. So I'm thinking the DefaultTableModel is not picking up the newly added rows.
If your inserting a lot, maybe a LinkedList would be better. Let us know what you come up with.
no, you can. Unless you specify the f at the end it defaults to a double though (causing a compiler error).
float is a single precision floating point number, double a double precision floating point number.
K, I knew I was going wrong somewhere.
You have the escape sequence backwards..That shouldn't even compile.
Here is a small example of what you should have:
import java.util.*;
public class TestTokenizer
{
public static void main(String[] args)
{
String tokenizeThis = "a cat is \"not\" a dog";
StringTokenizer st = new StringTokenizer(tokenizeThis);
while (st.hasMoreTokens())
{
System.out.println(st.nextToken());
}
}
}
And please proof read your posts. Maybe I'm just a stickler for spelling, but last time I checked 'prtect' wasn't in the dictionary...
:rolleyes:
I think I remember a program or something called "Universal Shield". I know it blocked you from opening files that were protected by it, but I don't know if that made the files unchangable. I would think(I could be wrong) that those system files are apt to change...I mean, what happens if you want to update a driver which is stored in that directory?
There's isn't a cd out there that's impossible to copy. You don't need any special kind of software, actually there's a program out there called "Alcohol 120%" that can copy any protected cd, even the strongest protection to date.
I guess you could look into apply some of these copy protection schemes to your cd..Some of them are "SecurRom", "SafeDisc", and many more. It won't protect everything from invidivually copied onto the harddrive, but it will protect the most important files. But again, there are programs out there that can easily break these protection schemes.
If the other computers have the JVM you can run the applications, but most likely you'll want to use some program that will package it like dark suggested.
That's great. I'll contact the honor society tonight(but wont get a reply till tommorow) and see what they say. Either way I'm interested in helping out. I believe it's an opportunity you can't pass up, and will probably do this regardless of what they say. If you like, you can give me a PM and I'll send you my email so that you can contact me and find out areas I'm good in and that kind of stuff.
Thanks.
How long do you think this will take you?
I'm suppose to do 15 hours of non-profit work for the high school scholars program. I haven't found anything yet, but if your interested let me know.
Those people really make me feel cool.
Update: It will be a Linux distro with most of the tools written in Java. I still need a name...
w00t (what's that mean anyway?) I'm now a "Posting Whiz" :)
What are you thinking? Name it after me...
By the way, get some more traffic to your forum so I can start posting again.
I was reading the api for Scanner and I could not find any readLine method. I think the reason it was allowed to compile, is somewhere down the line it inherits that method...But if it inherited it, it should be able to use it...?? I'm confused on that one. I know the readLine() method is suppose to be for the BufferedReader, but it didn't give us a syntax error.
You people actually believed that I wrote XP? Did you know that I also invented the internet(Not many know that either)?
The stop method will stop the sound completely, not at a specific. You need something that will actually pause it, instead of stoping the audio..
On the first exercise, you should have used .next() to read the string instead of .readLine(). I'm not sure why that didn't work unless that method is only for the BufferedReader. Maybe someone can help clarify that for you.
rating = scan.next();
On the second assignment, you should have something of the sort:
variable 1;
variable 2;
public constructorName(Clock c)
{
this.variable1 = c.getVariable1();
this.variable2 = c.getVariable2();
}
}
That is of course only the constructor. That should help you out a little. For me to help you out more, you'll have to show some work so I don't get yelled at for doing someones homework. One more thing, when I'm assigning those objects variables to the current objects, I'm guessing you have methods in the other class that returns the variables value.
Thanx for ur suggestion.
did it work?
I could: see the installation instructions ;)
Dont be a party pooper!
Anyways, try adding a period to the end of the classpath:
C:\Program files\java\jdk1.5.0\lib\tools.jar.
Get it. Got it. Good.
There's really no other way than creating a new array each time.
String[] original = new String[4];
String[] temp = new String[words.length+1];
original = temp;
I'm sure a performance hit would come out of that.
change this
private float d = 2.0f, sum = 1.0f, term = 0.0f;
It's very bad practice to declare multiple variables on a single line, never do it!
Actually you can't declare floats with decimall places can you? You have to add d a 'd' at the end to symbolize a double.
Check your environment variables:
I posted this in a previous thread:
Considering you have windows:
Goto start--->right click on my computer--->select properties
Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.
The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.
SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:
C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin
Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:
.;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar
Your's will look similar, although you do not need the .;%classpath%.; statement.
Next, you need to know how to access your files at the command line.
To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:
cd/javawork // brings me to the right directory
javac Hello.java //compiles my program
java Hello //runs my program
Let me know if you don't undestand something or need more help.
Is there a simple way to change a positive number to a negative number???
float d = 1.0f; How can I flip d between pos. and neg.?
Thanks in advance
if (d > 0)
{
d = -(d);
}
else if (d < 0)
{
d = Math.abs(d);
}
Of course this would work for both:
d = -(d);
that would make positive values negative and negative values positive.
There's like 65000 ports(if I remember correctly) to choose from, but remember to be careful about selecting one that doesn't have major process running.
You could always put it into a StringBuffer and reverse it:
import java.util.*;
public class ReverseTest
{
public static void main(String[] args)
{
int reverseThisNumber = 12345678;
StringBuffer sb = new StringBuffer(""+reverseThisNumber);
System.out.println(sb.reverse().toString());
}
}
Or you could use a recursive String reverse method:
public String reverse(String arg)
{
String tmp = null;
if (arg.length() == 1)
{
return arg;
}
else
{
//extract the last char
String lastChar = arg.substring(arg.length()-1,arg.length());
//extract the remaining chars
String remainingString = arg.substring(0, arg.length() -1);
tmp = lastChar + reverse(remainingString);
System.out.println(tmp);
return tmp;
}
}
Then you could go with highergrounds idea and use modulus:
public int revDigits (int num) {
if (num < 10) {
return num;
} else {
int s = num / 10;
int d = num % 10;
int i = revDigits(s);
return (d * 10) + i; // incorrect
// need to find out how many digits in d:
//return (d * 10^(num digits in d)) + i);
}
}
How long have you dealt with this error? Is it possible the servers at fault, and it's just a communication error? I would contact the administrator of the site and see what they say. Check in the java console, you never know the classname they are providing could be wrong.
Just as I thought. Some older versions of java are funny about how things are added. You actually have to include a call to get the content pane even thought you shouldn't.
Change this Line:
add(pane);
to this
getContentPane().add(pane);
I would suggest getting into the habit of creating a Container. If your use swing you should always use a Container:
Container content = getContentPane();
setContentPane(content);
content.add(pane);
You could also escape that error that way(Which I reccomed);
You should be able to easily do this with add() or remove(). Are you remembering that a Menu must have JMenuItems and not buttons? Also, if your getting an error, post it.
You think your active? It's my summer break; I sit here in front of my computer almost all day(Seriously!).
Are you the same guy in VBForums that ask the mods to ban you(for same reason) for a whole month(and actually got your wish!)?
Here, I found this.
When were the animals created?
The creation of animals is described twice - It is said to have occurred before Adam on the first occasion and then later when Adam was already present. Isn't this a contradiction?
The actual language is not contradictory, though the style of the storyteller is sometimes misunderstood. The Bible tells of the creation of living creatures and Adam on the 6th day (Genesis 1:24-27 (http://bible.gospelcom.net/passage/?search=Genesis%201:24-27;&version=31;)). In the next Chapter, the author retells in detail the story of Adam and Eve. God brings the animals (which he has already created) in front of Adam for him to select a helper. Adam names them, but no suitable helper is found. So God creates Eve. (Genesis 2:19-22 (http://bible.gospelcom.net/passage/?search=Genesis%202:19-22;&version=31;))
The confusion comes in that in the retelling of Chapter 2 (commonly known as a 'flashback' in modern scriptwriting), the author first quotes God as saying "It is not good for the man to be alone. I will make a helper suitable for him." Then proceeds to revisit the fact that animals were created. The word used in the original texts in this verse is the Hebrew "yatsar" in the past tense which translates correctly to "had formed". Reference Strong's Number 03335 (http://www.blueletterbible.org/tmp_dir/words/3/1107185987-7058.html). More modern translations use the correct verb tense, but this myth is propagated by the existance of unrevised editions of the KJV translation of 1611, which just has the word "formed" as …
Perhaps i'm being a bit cruel there, but I am sincerely trying not to be.
Not at all. I feel stupid after reading it again. I missed the small details. Anyways, I'm not a religious scholar, I don't have a phd in bible study so I don't know what to say. I'm sure if someone knew their stuff they could justify it somehow, but I can't. And I'm not really in the debate anymore, I'm just commenting and questioning. But it's like I said earlier, some people(as you) say there is contradictions and can give viable proof, but I'm sure there are people out there that can justify.
Jwenting, I see what your saying about Waco. I guess people of other religions could have thought that is how our religion is like I'm thinking about the hijackers.
Hannibal - Thomas Harris
A lot more interesting than the film, it gives details of Lector's childhood and how he became a mad cannibal etc.
That movie was really disturbing.
The Secret Window -- Stephen King (All time favorite movie and book)
Eyes of the dragon -- Stephen King
Shawshank redemption -- Stephen King
Apt Pupil -- Stephen King
Green Mile -- Stephen King
In the light of this discussion about Evolution and Creation, that's a rather large 'whoopsie', don't you think?
I'm afraid I don't understand :sad:
Could you explain.
If you'd taken the care to study other religions (and especially Islam in this case) you'd have found that Islam specifically prohibits suicide as well as the harming of Jews and Christians.
Sadly many influential Islamic leaders have political agendas (as do many religious leaders elsewhere) and can draw on a large base of people who like you don't study religious texts (even their own), instead taking the word of those leaders as being the will of god. In the Islamic world that's made worse by a large percentage of illiterate believers.
Aren't you contridicting yourself? Eariler posts you were talking about how people of religion kill each other. Now your saying people who can read and don't rely on words of others know that they don't do that. I don't understand, why are you changing all of a sudden? It's like I said, 19 of the hijackers were muslims(proven fact).
By the way, I know that Islam prohibits such an act, but they DID NOT believe they were doing wrong.
Also, it was rather inaccurate of you to say that I don't even study my own religion. You can prove no such thing, and know no such thing. I've kept this discussion out of my own relgion as much as I can. Unless your sitting here at home with me, then don't say I don't study my religion. I do not study other religions, you were correct about that. And I will NEVER study anyone elses …
Don't forget that you can do a google search and find plenty of sources that can prove the people who "think" there are contridictions in the bible" wrong.(not trying to contridict you cat)
This can go on and on, but it's not going to go anywhere. You can find sources and people who say one thing is correct and those people are able to back it up, and at the the same time you can find sources and people who can prove that wrong. (hope that made sense!). Anyways, if you read that there are inconsitencies in the bible you shouldn't take someones word for it. Read it and find out. If in your mind there are contridictions then you've proven it to yourself, but that doesn't mean someone else has read the bible and found no contridictions.
Medal of Honor. And no other game even comes close to it.
Most non-believers think people of religion are perfect and should never make mistakes. Just because you belong to a religion doesn't mean that you won't ever say stuff that will make people mad, or do things your not suppose to.
I think the biggest problem is the "riders" on bills. (I think they call them riders). It's like, if this bill is past, there is a bunch of attachments that go with the bill, and believe me, there are some REALLY STUPID ONES. If I remember correctly, a rider attached to this one bill was to fund(multimillion dollar) research to find out the flow rate of ketchup.
setBackground() might take an image object as one of it's parameters, but I don't know. If not, in the paint method you could use drawImage().