Forum: Java Apr 10th, 2007 |
| Replies: 1 Views: 1,073 Hey! There has been a question on my mind for a while regarding the JRE and the class loader (or, loading classes into RAM if it's different).
Java classes define variable members, methods, and... |
Forum: Java Mar 28th, 2007 |
| Replies: 3 Views: 1,951 Have you researched this?
Perhaps, and especially for questions such as yours, you should check Google or some other appropriate search engine for results.
You seem to know the words "Java" and... |
Forum: Java Feb 18th, 2007 |
| Replies: 8 Views: 1,373 One reason for the "no" is that Java uses Java-specific resources.. Take the hundreds of importable classes, for example. Take swing, awt, net, etc, etc, and realize that all of these packages were... |
Forum: Java Feb 17th, 2007 |
| Replies: 2 Views: 1,096 You have to analyze the input one character at a time...
Say we have a string: myString
Set up a for loop with a lower limit of 0 and an upper limit of myString.length()-1 inclusive
Read... |
Forum: Java Feb 16th, 2007 |
| Replies: 7 Views: 1,968 Good thoughts. I've always been a strong supporter of the "open source" concept, even though (as you've made it clear) the source need not be distributed for another programmer to find out how the... |
Forum: Java Feb 16th, 2007 |
| Replies: 7 Views: 1,968 Yea, like someone in serious need of "homework help".
Jars are just another archive-type file.. The purpose is to hold a number of files under a common name, "myfile.jar", to keep organized and to... |
Forum: Java Feb 14th, 2007 |
| Replies: 4 Views: 1,250 Hmmm. I can't be super helpful before I fall asleep tonight, but..
First thing is working with Generics (http://java.sun.com/docs/books/tutorial/java/generics/index.html)
Regular expressions?... |
Forum: Java Feb 12th, 2007 |
| Replies: 3 Views: 3,045 *squints at code*
.....
Haha, silly me. I missed this at first glance.
1) instead of *.addActionPerformed(this); use *.addActionListener(this);
2) e.getSource() returns an Object, and... |
Forum: Java Feb 8th, 2007 |
| Replies: 3 Views: 1,008 Unplug the keyboard.
Or write the impossible virus.
Not sure what you want to know...
Locking, aka, disabling input?
Input to the entire system?
I dunno if Java can do that.
Maybe if... |
Forum: Java Feb 8th, 2007 |
| Replies: 6 Views: 2,989 Does (ballX, ballY) represent the center of the ball, or the top-left edge of the bounding square?
For one, this if statement looks somewhat "iffy":
if (ballY < 0 || ballY > (getHeight()-25) &&... |
Forum: Java Feb 8th, 2007 |
| Replies: 4 Views: 940 import java.io.*;
import java.util.*;
import Employee;
The problem is with import Employee; --- you can't import classes from the same package without at least giving the package... |
Forum: Java Feb 7th, 2007 |
| Replies: 0 Views: 6,333 Often we're faced with the need to represent primitive data types as readable/writable bytes that can be sent through a data stream. In Java, there are classes such as... |
Forum: Java Feb 7th, 2007 |
| Replies: 3 Views: 1,090 Is there any way we can filter threads like this from being posted? Or, can they be removed? I'm not sure, but I think DaniWeb could go without such dribble as do-my-homework demands. |
Forum: Java Feb 7th, 2007 |
| Replies: 4 Views: 1,948 Oh my.
For one, I think this is how you meant to represent your code:
class Rev {
char a[];
char i=3;
void str() {
for(i='A';i<'D';i++) { |
Forum: Java Feb 5th, 2007 |
| Replies: 7 Views: 24,043 I was thinking the same: wonderfully, unnecessarily large, but, that's how I used to code when I first started out. Make friends with arrays. Your exact program - the logic and all - could be... |
Forum: Java Feb 5th, 2007 |
| Replies: 1 Views: 3,425 Alright!
I love answering my own questions. I hope that someone can learn something from this!
I conducted two tests. The first test locks the entire myArray array. The seconds locks a... |
Forum: Java Feb 5th, 2007 |
| Replies: 1 Views: 3,425 My question today is regarding multidimensional arrays, and synchronization.. I'm working on a client/server project and I'm not sure about the theory of an idea I came up with:
I have an array:
... |
Forum: Java Feb 2nd, 2007 |
| Replies: 3 Views: 1,364 :o I noticed that little capital after posting.. Just didn't change it. Please excuse any naive stylistic choices, as I'm not yet completely accustomed to "convention".
And I did stumble upon the... |
Forum: Java Feb 2nd, 2007 |
| Replies: 3 Views: 1,364 Hi! I'm looking to learn something today, and I have just the question.
In writing a recent program, I found no Java method suited to compare two byte arrays. Maybe the method exists, or maybe... |
Forum: Java Dec 28th, 2006 |
| Replies: 20 Views: 160,254 Only way I know how to emulate a switch on strings, and this has already been mentioned without example code, is like the following:
void StringSwitch (String str) {
if (str == null) { /* If the... |
Forum: Java Dec 28th, 2006 |
| Replies: 3 Views: 1,861 So I've run into this situation a million times in my "learning career" and I've always found a long way around the issue so as not to risk throwing unnecessary exceptions..
Let's look at a simple... |
Forum: Java Dec 3rd, 2006 |
| Replies: 9 Views: 5,357 BECAUSE, that's not fun.
I "play" with Java to learn.
I know there's an easy way around everything, and if this were my job, I'd probably take the easy way. I, however, like to learn, and I like to... |
Forum: Java Nov 24th, 2006 |
| Replies: 9 Views: 5,357 Long post, I know, but I just discovered:
Likewise, for the chararray-to-int method:
(it doesn't work properly any other way. Try 2147483647 as the value.)
public static int ToInt (byte[] data)... |
Forum: Java Nov 24th, 2006 |
| Replies: 9 Views: 5,357 SO, I'm playing around with an idea. I'm trying to convert primitives to and from a char array for file logging. I've got all the details worked out, but I don't understand something.. Take the... |
Forum: Java Oct 23rd, 2006 |
| Replies: 3 Views: 6,321 Ahh! Thank you very much!
I reliased today when I found the "This project is not JDK 1.5 compliant" error that my workspace wasn't configured for 1.5, so I checked workspace settings and, sure... |
Forum: Java Oct 20th, 2006 |
| Replies: 3 Views: 6,321 I installed Ubuntu Linux this morning and got java jdk 1.5.0_09 installed, along with Eclipse, and then I imported a project I've been working on into the Eclipse workbench.
All configuration is... |
Forum: Java Oct 6th, 2006 |
| Replies: 2 Views: 3,670 I hardly understand what you're doing or why, but here's the recursive solution.. Recursion is unnecessary and stack-dangerous, by the way. (StackOverflowErrors are ugly). Using a StringTokenizer is... |
Forum: Java Oct 6th, 2006 |
| Replies: 1 Views: 1,084 I think the proper way to escape Quotes is
"Here is some \"Text inside Quotes\"" :rolleyes:
And no. It's not platform-independent.. That would be the File Separator, which is "\" in Windows... |
Forum: Java Oct 6th, 2006 |
| Replies: 4 Views: 2,661 I think I may know what you're talking about, as I faced the apparent issue myself just last week. It was quite something. If I've misunderstood and all the following information is unrelated, then I... |
Forum: Java Oct 5th, 2006 |
| Replies: 0 Views: 1,547 Hi! Here's my scenario:
I have an application that utilized the DatagramSocket class. I also have a favorite Port number that I would like it to connect to Every time I load the application. One... |
Forum: Java Jun 19th, 2006 |
| Replies: 5 Views: 2,203 :cool: There was nothing wrong with my code.
It was the JRE/JDK..
I installed version 1.5 (I was using 1.4.2) and it works perfectly now.
Sorry for the confusion, but if anyone else encounters... |
Forum: Java Jun 19th, 2006 |
| Replies: 5 Views: 2,203 Yep. That's pretty much what I had:
JTextArea output = new JTextArea("");
//output.setEditable (false); // leave true while testing
JScrollPane JSP = new JScrollPane (output);... |
Forum: Java Jun 19th, 2006 |
| Replies: 5 Views: 2,203 Sooo...
I just started designing the GUI for an application that I'm writing..
And, well, I can't get either the awt.TextArea OR the swing.JTextArea to work properly.
Here are snapshots of both,... |
Forum: Java Jun 19th, 2006 |
| Replies: 6 Views: 1,482 ................................................. (Delete this -- Accident Post) ................................................. |
Forum: Java Jun 19th, 2006 |
| Replies: 6 Views: 1,482 It won't let me edit my previous post, so..
Incase anyone noticed in my code, in the main function I said...
public static void main () {
// Dunno why, but can't get this to run under SuSE 10.1... |
Forum: Java Jun 19th, 2006 |
| Replies: 6 Views: 1,482 :eek: OH - MY - GOSH.
:cheesy: I figured it out.
I think it's been about a total of.. hmm.. 10 hours, now, trying to get this?
I've been playing with it all morning, and it finally compiled... |
Forum: Java Jun 11th, 2006 |
| Replies: 6 Views: 1,482 Here's an example I wrote that works, but it's primitive.
TestExtension.java
public class TestExtension {
public static String retClassName () {
return "Class Name: TestClass";
} |
Forum: Java Jun 11th, 2006 |
| Replies: 6 Views: 1,482 So. I'm having an issue.
I'm building an application that loads class files as extensions during runtime. I'm doing this, becuase I want my application to be able to grow in the future without... |
Forum: Java Dec 1st, 2005 |
| Replies: 3 Views: 8,051 YAY! :mrgreen: it works! that took a large chunck out of my life, but finally I came up with the following code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import... |
Forum: Java Nov 29th, 2005 |
| Replies: 3 Views: 8,051 This is irritating me so bad, I have spent three hours aimlessly trying to get JScrollPane to work on my JList and I can't figure it out.. here is the code, please make the scroll bars work! :sad: ... |