using classes in a JAR file

308 byte By atamela at 2007-9-30 1:25:25
Hi,I have a JAR file and I have another java file (call it myFile.java) that wants to use some of the classes in the JAR file. I'm wondering if this is possible. If so, how do I compile myFile.java and how do I run it? I assume I need to set the classpath to include the JAR ...

Switch Statement

869 byte By robwaltera at 2007-9-30 1:25:26
I Have an assignment to change an if statement to a switch statement to this statement belowif (a == 1)x += 5;else if ( a == 2)x += 10;else if ( a == 3) x += 16;else if ( a == 4) x += 34;elsex += 40;I am confused, first off I dont know what the controlling expression is. I do know that a switch ...

Chess Piece display problem in applet

3946 byte By murph_a_monga at 2007-9-30 1:25:45
Hi,I'm writing a chess game applet which will be played between to players over the internet. I'm currently working on the applet side at the moment and will develop the server side once I have completed the applet. I'm currently having problems displaying the actual chess pieces on the ...

Java Question

506 byte By Prog1Mana at 2007-9-30 1:25:53
I am a newby and learning how to program in java. I read a bit about java and started simple programming, but I do not understand what this few syntax are used for and their proper purpose in a java program. 1) public2) void3) static, etc. THe book didn't really explain their purposes so I ...

Question about method synchronization

1232 byte By lgmqy2000a at 2007-9-30 1:26:02
Hi, folks. here is my mystery: as you can see from the code snippet below, both the freeBusyFlag() and getBusyFlagOwner() methods are synchronized. So, 1. does the thread hang at the getBusyFlagOwner() while waiting for the freeBusyFlag() method to free the object block? 2. If not, and the ...

Write data to file problem

1015 byte By sstathaka at 2007-9-30 1:26:03
Hi,I am new t Java and I am writing some code to inrder todo these:1st I try to write data that is entered in Textfields in various Frames by pressing a button. I have tried this void jButton3_actionPerformed(ActionEvent e) throws IOException {FileOutputStream fos = new ...

Defining Variables

102 byte By hyee1a at 2007-9-30 1:26:06
Is it better to define variables all at the top or within your code when you need the variable?

help coding text based rpg

3835 byte By xytora at 2007-9-30 1:26:11
i already have the structure set for adding rooms, and walking, and commands, but i still need to know how to make a character class that stores items (that are also inside the rooms), and an enemy class (enemies are also found within the display info of the class, and can attack.here is my ...

import quickie

927 byte By MRjavajeffreya at 2007-9-30 1:26:23
Hi,can someone help me with importing? I am trying to use Digester for parsing through my XML document. I have the jar file, which is namedcommons-digester.jarWhen I look through it, I see an "org" folder, then inside that I see an "apache" folder, inside that I see a "commons" folder, inside ...

Java and other languages

229 byte By ReptileKing234a at 2007-9-30 1:26:51
Basic question - can java be integrated with php? I know java and C++ can work together, but I don't know about scripting languages... and is there a place I could find good info on how to make them work together? thanks.

making an exe?

241 byte By xytora at 2007-9-30 1:26:54
how do i make an independent executable file from the compiled .java and .class files?if i cant do that, then is there a way of making the exact thing appear as an applet, without using any paint methods, or anything like that?

How to communicate with serial port?

254 byte By lanceDlynxa at 2007-9-30 1:26:55
I want to send/receive data through the serial port. what articles/topics should i read ?I would also appreciate it if anyone could share me articles/topics to read to understand how to processSMS (cellular phone text messages) data.

Eureka! Is that how it works?

2481 byte By grand_poobaha at 2007-9-30 1:26:57
Hello again world.I think I have achieved a "light bulb" moment and I'm asking for anyone to either confirm it or shoot me down. I'm just getting into GUI stuff. I have a two line main method that simply instantiates a MyFrame object and then displays the frame.Here is a piece of the MyFrame ...

dynamic variable names

632 byte By TrailerTrasha at 2007-9-30 1:27:02
Can I declare and use variable names dynamically? I know you can't use $ like you can in perl, but I'd like to do something like:for (i = 1; i < 65; i++) {for (j = 1; j < 9; j++) {JTextField part$i_seg$j = new JTextField("0", 5);}}Then assign the values of the text fields to an ...

Class not found

595 byte By yeshmana at 2007-9-30 1:27:08
Well this is my first applet, so this might be a easy question to answer. When I create a html file and add in an applet, i get a big gray box and the error class war not found. I have the classes and the html file in the same directory. Here's my code so far:<applet code="warprogram.class" ...

is javax.comm class for free?

90 byte By lanceDlynxa at 2007-9-30 1:27:22
is the javax.comm class for free? i.e., does it come with the j2sdk 1.4.1 download?

<--What's this little red square?

30 byte By grand_poobaha at 2007-9-30 1:27:24
Subject is the question

Free Install utility ideas.

304 byte By mapgaonka at 2007-9-30 1:27:27
Hello all,Hope everyone is having a great day.I wanted to get some inputs on some free installer utilities that can be used to painlessly install Java projects on Windows/Linux boxes. What would be something I should use? Any help will be most appreciated. ...

Image Coordinate

625 byte By smurf684a at 2007-9-30 1:27:36
Hey,I took screen shot of my whole screen and using locationonscreen i can get where the application i interested in locate at. but the problem is the image i took from the screen shot is need to be rescaled so the coordinate pointinside that image will be different than the location onscreen ...

yet another string to date format question

488 byte By coach-xa at 2007-9-30 1:27:40
I have searched the forums and cannot find the exact answer I am looking for so here goes. SimpleDateFormat sdf = new SimpleDateFormat("M/d/y");String strDate = "02/25/04";Date myDate = sdf.parse(strDate);gives me : Wed Feb 25 00:00:00 EST 2004but I need the output of myDate to stay 02/25/04 in ...

Any white paper on "Effort estimates..."

116 byte By @nuraga at 2007-9-30 1:27:46
Can someone point me to any good document (or White paper) on estimating efforts in a java project.-a.

store JAVA_OBJECT in databases that do not support it

96 byte By rtrama at 2007-9-30 1:28:35
Is it possible to store a JAVA_OBJECT in a database that does not support this data type?

How would you write a "wildcard" in a filefilter?

697 byte By Karl_XIIa at 2007-9-30 1:28:42
How would you go about to have a wildcard instead of the "*" in the following filefilter; File[] files = new File("./resultat/resultat_" + "*" + "_" + index[0]).listFiles (new FileFilter () {public boolean accept (File file) {return ! file.isDirectory ();} });All help appriciated- Karl ...

To access the value of a variable by the name of another variable

228 byte By correroa at 2007-9-30 1:28:46
How do I dynamically access the value of a variable by a name from another variable?For example:String var = "myvar";I wish to get the value of a variable named "myvar". How do I get it?Thanks!

installing javax.comm

130 byte By kent_emiaa at 2007-9-30 1:28:51
hi there .... how to install this package .. can't find any documentation, if there was , maybe i've skipped the page ...

I am pulling my hair out :(

2227 byte By enderwiggina at 2007-9-30 1:28:58
I can't figure out what I should use to terminate my quick-hull method that uses divide and conquer. Must stop the recurrsion but everything I have tried has still given me a stack overflow error. If you need more info I will be checking back every couple of minutes.If any one would take the ...

Checkbox

158 byte By new2003a at 2007-9-30 1:30:03
Hi!When should I write like this: checkbox.getModel().isSelected();and when should I write like this:checkbox.isSelected();

Long.parseLong(String) fails for number formatted as #.#E#

381 byte By bbbubbbaa at 2007-9-30 1:30:07
I am trying to convert a string to a long, but it is failing on me. Below is a code snippet:String timeStr = "1.0765902707E9";long time = Long.parseLong(timeStr);System.out.println("Time: " + time);I'd appreciate any help you can provide on this problem. ...

Sorting Strings

265 byte By Alan_Shearera at 2007-9-30 1:30:14
HiI have an array of strings(names) and i want to sort them alphabetically . I dont have clue how to do this and ive searched the API's etc to find out if there are already classes that i can import but i cant find any. Please help,Many Thanks

A few basic questions....

3355 byte By RageMatrix36a at 2007-9-30 1:30:24
Hi all, Been a busy bee learning java in the past few weeks and I have a few basic (yet varied) questions....When declaring Strings, what is the difference between: -String myString1 = "This is a String";and String myString2 = new String("This is also a String");When writing to a outputstream ...

Representing Java Byte Code Instructions...

3297 byte By redempti0na at 2007-9-30 1:30:32
Hi,I am trying to represent java byte code instructions as subclasses of another class called instruction.the four things that I am asked to do are:+ decide on fields each class require to store operands+ complete the constructor+ implement toString() method for the class+ set visibility of the ...

Installation Problem?

868 byte By Dookie05a at 2007-9-30 1:30:35
I've been having problems running applets, even ones I didn't write, that I know already work due to being from the web etc. They compile fine and my references in the html files I've double checked etc. So I have the class file and the html files all set up ok but they still don't seen to ...

Shuting down Tomcat 5.0

536 byte By tommaliaa at 2007-9-30 1:30:48
I know this isn't the best place for this post. But I don't know where else to turn.I've recently installed Tomcat 5.0..... It ran great BUT I can't seem to shut the D$%$^#M thing down now. I need to restart the Application server but Shutdown doesn't do anything. According to the win2K ...

Why operator overloading is not implemented in java

207 byte By Vishal.MKa at 2007-9-30 1:30:51
dear friendsplease tell me if we can overload methods , why can't we overload operators aswe do in c++.Please reply , as I have to submit my questions to my teacherthanks.

Sorting Names Alphebetically

503 byte By Alan_Shearera at 2007-9-30 1:30:52
HiIve been creating a program to hold Strings (String intial, String name, String number) by putting them into Person[ ] entry. Now i have methods like getName,getNumber,getInitial etc and i want to sort this array Person[ ] entry to print out the array in alphebetical order and i have no idea ...

Client-Server Application

297 byte By giulio_bra at 2007-9-30 1:31:08
Hi everybody!I'd like to confirm if it's possible to replace the programs developed in Visual Basic.NET by Java? Including local file access, Databases, ODBC, GUI etc.In other words, to develop traditional MS Client-Server application to run standalone in a

Passing an array to a method taking an Object?

682 byte By tancooka at 2007-9-30 1:31:20
Hi,I need to pass an array of randomly generated numbers to a method that takes an Object. I can't seem to figure out how to do this...Here is my code for creating the array of random numbers:Random generator = new Random();for (int i = 0; i < size; i++) a[ i ] = ...

NoInitialContextException

953 byte By jgowdera at 2007-9-30 1:31:40
I am trying to connect to DB2 Database, which is sucessfully configured to DB2 database in the data sources in IBM WebSphere 5. When I try to run the following code, I get "javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root ...

Arrays

125 byte By Opyusea at 2007-9-30 1:31:41
I know the array.length method gives you the length of your array but what gives you the number of values it contains?

Policy file for use in web browers?

344 byte By MattCrillya at 2007-9-30 1:31:58
Hi,I'm new to java, and managed to get a policy file which allows access to write to a file on the server using the command:appletviewer -J-Djava.security.policy=mypolicy http://mywebsite/My question is, how can I provide the same read/write permissions for the applet when viewed in IE?Thanks ...

packages and inheritance

801 byte By grand_poobaha at 2007-9-30 1:32:01
Hello again world.I have a class called "MyFrame" which is declared public class MyFrame extends JFrame implements ActionListener {which then goes on to set up the JFrame and add listeners to some JButtons.Then, I code the actionPerformed() method of the ActionListener interface public void ...

Converting decimal -> minutes

236 byte By simmosn123a at 2007-9-30 1:32:04
A have a program that asks a user to enter a song length in minutes.a 90 second song would need to be entered as 1.30, but this is wrong as it should be 1.50.Does anyone have any idea how to perform this conversion?

Regular expression help

469 byte By edecaa at 2007-9-30 1:32:05
I have the following regular expression:\\([0-9]+[-\\+\\*/][0-9]+\\)It will match anything like (8+9) or (15*30), the double \\ is because I'm storing it in a String. However, my input string might be:((8+9)+6) or ((8+9)+(6-4))It will always be in parenthesis as above, though. How can I extend ...

prompting user input from command prompt

197 byte By odelayiha at 2007-9-30 1:32:12
I was hoping someone could tell me if Java had a built-in function to prompt the user for input, similar to:"cin >>" in C++,and"scanf(..." in ANSI C.Thanks.

File IO

393 byte By sgk_17a at 2007-9-30 1:32:15
I'm trying to check to see if a file exists and if not, go somewhere else and get it and copy it over. The subdirectory may or may not exist also. How can I check to see if the subdirectory exists, and if it does, check to see if the file exists? I thought about using a URL object and trying ...

toolbars

351 byte By ike2010a at 2007-9-30 1:32:19
Hello. I wrote a basic java app that deletes my temporary internet files, history, cookies, etc. I would like to place a toolbar (or just a button) in Internet Explorer 6 that will run the program.I'm not really sure where to start looking on how to accomplish this. Does anyone know how to do ...

Choicebox + TextArea (non-swing)

1034 byte By dasilva109a at 2007-9-30 1:32:23
How can I get TexArea to display whatever I chose from a choicebox?Here's what I have so far:import java.awt.*;import java.applet.*;import java.awt.event.*;import java.awt.TextArea.*;public class FruitCocktail extends Applet implements ItemListener{Choice fruitChoice;TextArea textArea;public ...

databases that support JAVA_OBJECT

67 byte By rtrama at 2007-9-30 1:32:34
What databases support JAVA_OBJECT and where can I get them?

upperCaseToLowerCase

560 byte By shutterbuga at 2007-9-30 1:32:37
For a class project we need to convert a single upper case character to a lower case character using the following method declaration:public static char upperCaseToLowerCase(char ch)But I cannot get it to convert. Can this be indicated in the method in this form?Character is to be entered from ...

Excel

259 byte By TomVdHa at 2007-9-30 1:32:44
hellow all is it possible to get a specific cell (row, colomn intersection) ;-) from your spreadsheet into a java application and then browsing in the sheet so that u can get other cells in your application through pushing a buttonthx in advance