43 byte By
ruler88a at 2007-10-1 0:13:17
How do you generate a random number?
462 byte By
tn999a at 2007-10-1 0:13:30
Hi, I was wondering what topics do I need to know to write a java program that'll post messages on a certain forum w/ login and password etc. If anyone can tell me what I need to do or what topics I should look at let me know. I haven't covered things like networking yet so I was wondering ...
<whisper>pssst.....where is everyone? </whisper>Hello?!<echo>Hello?!</echo><echo>Hello?!</echo><echo>Hello?!</echo>So quiet today... did everyone's internet access die? Or did I miss a memo or ...
Is there a method in the Java library that preform a binary search?
192 byte By
chuimuia at 2007-10-1 0:15:02
how do i make my buttons talk when i hover over them with my mouse in a html page?what are the codes?im using java script.please help...i need to submit my project by tuesday...
188 byte By
mql80a at 2007-10-1 0:15:10
Hi,How would I do this:The file name must be hash.java and the run-time Java Application it creates must have the name hashApp.Thanks ahead if you could help...
5728 byte By
chuimuia at 2007-10-1 0:15:12
below is the codes..where do i enter the tool tip for my buttons which are in frame format..pls tell me..i want the tool tip to dispaly"press here". what is the line of code i shall enter.im sooo blur...<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 ...
I'm working on a preschool game project. Its like counting objects and matching with the object that has the same count. I'm planning to have 10 questions(pictures) and 3(pictures) choices for each question. I dont want the questions as well as the choices to be repeated in the same order. ...
373 byte By
xleybaa at 2007-10-1 0:15:29
HelloI've my application class files wrapped in a jar file. My application use some other classes (jakarta.commons, metouia look&feel, etc) and I want to know how could I add them to my jar.Now, I added them without problems, but when I launch my application, it hangs because couldn't ...
1256 byte By
johnny5a at 2007-10-1 0:15:40
public RowSelectionPanel panel1a;public RowSelectionPanel panel2a;public RowSelectionPanel panel3a;public RowSelectionPanel panel4a;public RowSelectionPanel panel5a;public RowSelectionPanel panel6a;public RowSelectionPanel panel7a;public RowSelectionPanel panels[]={panel2a, panel3a, panel4a, ...
hi. very new here.Just say I had a String bla= "This is a messge"How would I break the sentence down and find all the single chars, like if(see letter 'i' in this string) then (add one to int vowels or somethin)
338 byte By
cs00003a at 2007-10-1 0:17:05
Hi,i`m having problems saving the name of an instance to a String variable.For example if i`ve written the following code:String s;A b = new A( );i`d like somehow the name of the instance(character b) to be stored to the String variable s.If anyone knows any method or way to do this please ...
Hi all,I'm trying to run two difeerent Client/Server progams at once. The first program is a chat server and the other is a game server. I have run into problems when trynig to run the two programs at the same time.Is there a way to run the two Servers at the same time?At the moment the first ...
Hello again world.What exactly is JavaScript?Why is it so ubiquitous?Where or how does it fit into the big picture?I found Sun's Java Locator Map - or something like that - but it was useless.Thank you one and all.Ciao for now.
1686 byte By
chankela at 2007-10-1 0:18:00
BufferedReader readCode = new BufferedReader(new FileReader("code.txt"));String code = readCode.readLine();while(more) {int j = 0;System.out.print("Code:");String productCode = in.readLine();if (productCode.equals("XX")) {// Break of the loop if product entered is XXbreak;}while (code != null){ ...
499 byte By
Wanchana at 2007-10-1 0:18:08
Can I execute something like this from within a java code to map a network drive in a Win2k/XP environment:Result = shell(net use s: \\servername\share password /user:servername\username /PERSISTENT:NO)I would also like to check if the drive mapping was successful. If the drive already exist, I ...
when iam is trying to install the netbeans 3.6 problem occured and notepad text error is appeared to me its look like this:An unexpected exception has been detected in native code outside the VM.Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at ...
I'm new to java so I'll try and make my question as clear as possible...I am using Netbeans 3.6I have a class that extends applet that is basically a data entry form(has lots of text boxes, buttons, and labels.I have this other class that let's say also extends applet that has a text box for ...
What does the following line do?Class.forName(driver);(driver - is private static final String)Thanks....
501 byte By
_topaz_a at 2007-10-1 0:18:34
hiI have a recursive method. To keep track of how many times it is executed, there's a counter that increments before the method is called again. The counter is an instance variable. I have written a method to access the counter outside the class. In the other class the counter is returned. ...
Hello, I am just writing a program using vectors.The problem is that I am not sure, if I can do this: Vector [] v = vector; public boolean member (Object element, Vector[] vector){Object e = element;Vector [] v = vector;//get the length of the vectorint size = v.size();}Then I get an error ...
Is there any real performance advantage to using shorts instead of ints? I gather that they get stored as ints anyway, but will comparison and inc/decrementation be any faster?
I'm trying to write several strings to a text file that need to be on separate lines.I have combined the strings into one and am including the "\n" character within the string to satisfy the formatting i want.I am using a file stream, file channel and a byte-buffer etc to write to a file and ...
I'm not very familiar with a lot of java gui stuff, yet here I am trying to create a fancy gui for a honors project. I've read up on most of the basics, but I haven't seen anything that looks like what I'm trying to do. I have one class called MazeApplication with the program's main method ...
Ok, now before you look at the code and turn away, the problem I'm having is not as great as the length of this code here. I tore out what shouldn't be applicable to my problem. I went around looking at different applets, and some of the code in here is borrowed from a certain applet i liked. ...
467 byte By
Meriamya at 2007-10-1 0:19:56
hello everybody the program iam writing has two lists and 2 buttons ( add and remove)the user selects an item from the 1st list and copies it to the 2nd listand when ever the user select an item s/he appends it to the copied listand the other button removes the selected items from the 2nd ...
Ok Folks,I am new to J2EE. I have just completed my J2EE course and understandibly I'm now confued. My company would like to develop a full on J2EE Compliant Application but it doesn't have the financial muscle to buy the expensive EJB Containers? So can we achive a serious J2EE Application ...
hi,I 'm building an Applet where a picture is being composed (in coordinates 90,0,191,228).Once complete, the user should be able to click a button and have the result (the picture)mailed back.Is there a way to accomplich that? I graw directly onto the Appletwith the method paint(Grapgics ...
Hello, I want to add an "int" to a vector. Now the problem is that a vector holds objects, how can I convert an int to an object. or is there any other way to add the int to the vector?Thanks.
7311 byte By
Vismunda at 2007-10-1 0:21:07
Here's some code I am working on for my CompScience class. If any of you more advanced java users can assist me in simpliying this code, it will be much appreciated. Thanks import javax.swing.JOptionPane;public class lab09b{public static void main (String args[]){String str;int num = 1, den = ...
Is it possible to implement sound features to an application program?
Ok, i am very new to Java.At university we have been using netbeans 3.6 along with Java Elements.I've downloaded netbeans 3.6, it's installed perfectly and i've downloaded Java Elements from 2 places, different .zip names but they both have the same content.oh, one more thing, Windows XP ...
506 byte By
maqka at 2007-10-1 0:21:24
hi, this may sound like a dumb question, but i have a small program for booking hypothetical swimming lessons, the input is obtained from a bunch of textfields, i was wondering for validation purposes, how one can check the user has entered valid data to go into the variables, e.g. if they put ...
How to add wav files to components that are in an application?I'm added an icon to a button. Button is leaving some space(padding) around the icon.How can i remove it .
(On XP Home PC) - Just installed J2SE Version 1.4.2 into C:\j2sdk1.4.2_06, followed by J2EE Version: 1.3.1 FCS into C:\j2sdkee1.3.1 & I have an anoying configuration problem .I opened a DOS window & went into my projects folder. Command "java -version" works - gives version & full ...
Heya i have an array of "Team" objects set up in my teamApp main class like:. . .teamArray[0]=new Team(1, "trailBlazers",23);teamArray[1]=new Team(2,"knicks",22);teamArray[2]=new Team(3,"spurs",24);in my Team class i have set the constructor as:public Team(int teamId, String TeamName, int ...
Hello,I downloaded a package called mpt.jar which I can successfully use in one of my programs, e.g Program1:import mpt.*;public class Program1{...//here I can use classes from mpt.jar}I have been compiling this class by:C:\MyPrograms> javac -classpath c:\lib\mpt.jar Program1.java.And the ...
Well I missed the class, but I found out what I have to have for monday... A simple class to simulate dice rolling, and were using a Random Ultiliy, and all I know about importing it is above the class having import.javautil.Random the rest of my code is this import java.util.Randompublic class ...
8673 byte By
Polluxa at 2007-10-1 0:21:45
hola,I am having a problem defining something, I am using a class called Explosion that loads an image (extends sprite) and in my main code when I try and setup the "brains" of the explosion it cannot find the symbol:import javax.swing.*;public class Explosion extends Sprite {protected int ...
3386 byte By
zachvaca at 2007-10-1 0:21:47
I have a program that reads names from a file and displays them on a JTextArea. I place that on top of a JScrollPane.I have added a sort feature where it will sort ascending or descending by last name. There's a JMenuBar at the top and it has the options. Here's the method actionPerformed ...
I'm new to Java and was wondering what is the difference between Java and Perl. Other than Java has to be compiled and Perl does not. Is one better than the other? Here is a link to my website. The languaged used is Perl. Can Java be used to write a program like ...
1514 byte By
xtxa at 2007-10-1 0:21:50
Code: The purpose is to find a character in a string, and report how many times the character occurs in the string. Basically the program does looking and counting. The code is complied and working well, but my goal is to make it as short as possible, if you can just write a program does the ...
I can't see anything wrong with this but I am getting errors.import mpt.*;import java.io.IOException;public class Program2 extends Thread{public Program2()public void run(){public void test() throws IOException{Navigator nav = new BlockNavigator(); }}}Error 1: Line 7 ; expectedError 2: Missing ...
When i click on a button it should play sound.But its not playing sound.Can anyone pls help me? public void stringToAudio(String audioFile){try{audioURL = new URL("file:" + new File(".").getCanonicalPath()+"/"+audioFile);audioClip = ...
I have set up a main method containing a list, an example beinglist1.add(new data(3,"April","Ben","17:00"));i want to access just one of the data parts in this entry ie. "Ben".i have a getName method in a Name class like:public String getName(){return name;}the problem is that when i callint ...
I have an assignment to write a college scheduling program that can be sorted by number and prefix and i need to use the Comparator interface to compare the prefix the user is searching for, and class number the user is searching for. I have done the number interface but i need to do the ...
191 byte By
zachvaca at 2007-10-1 0:22:50
I have a JApplet and I want to put a KeyListener on it. Which object to I invoke the addKeyListener on? I tried the content pane but it didn't work. Where do I add the KeyListener to?
Hi,I have 2 Java pograms each having main() method.Both main() methods then call various methods of their own class.I want that one Java program calls another Java program.Is it possible? I'd appreciate if someone can give me a short example of this call.Thanks in ...
386 byte By
zachvaca at 2007-10-1 0:23:08
Is there some way to do Runtime.exec(); but not return to the rest of the code until the person exits the program you're executing? Example:Runtime.getRuntime().exec("C:/myProgram.exe");//my application writes to a file//read from the file hereis there a way to do ...
330 byte By
Liz00a at 2007-10-1 0:23:37
Hi!I've got a problem with the login of my program:I want to get the first character out of a String to select two types of users.eg. login "a20202" --> a --> first kind of user or login "b20202" --> b --> second kind of userCan you please help ...