NEED HELP WITH COUNT OF WORDS/CHARS IN A FILES

3690 byte By artmaza at 2007-9-30 1:44:16
Hi,I need help with creating a program that uses a hashtable to count the number of words and punctuationsfrom a text file. I have some success in it counting the words correctly in the file but I cannot get it to count the punctuations or display the results in correct form ...

extends JApplet implements ActionListener

8241 byte By oops_there_it_is_a at 2007-9-30 1:44:44
I'm working on an applet that will use the ( extends JApplet implements ActionListener ) In my first debugging stage, I want to display the basic message(s) and get the first input. If you are familiar with a similar program that uses these techniques, I will be happy to look at it. I ...

newbie ques

1401 byte By Hal@a at 2007-9-30 1:44:48
HelloNot sure why all my applets quit working. For this one I am getting the error - c:\java\bin>javac AdditionApplet.javaAdditionApplet.java:3: Package javax.swing not found in import.Import javax.swing.*;AdditionApplet.java:7: Superclass Japplet of lass AdditionApplet not found.Public ...

con anyone write these programs(moved)

2065 byte By J0eFr0a at 2007-9-30 1:44:56
Question oneA mail-order house sells five different products whose retail prices are as follows: product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87. Write an application that reads a series of pairs of numbers as follows:a) product number;b) quantity ...

get values from a textfile

988 byte By krrajesh2a at 2007-9-30 1:44:59
The following is the format of a text file from which I need to extract a couple of values.One way is to use Properties to load these values into hashtables and get it.But just for getting one or two values, I dont want to load every thing.Is there any other SIMPLE way. How about parsing using ...

Help me ot with this please

2017 byte By smartnasha at 2007-9-30 1:45:05
Hi, Will let you know what I have done so far.E:/sampleapp/WEB-INF/sourcefiles/controller/ControllerServlet1.java/model/UserValidator1.javaI have set the classpath appropriatelyie., e:/sampleapp/WEB-INF/sourcefiles/controller /model This is where the class files will be stored.I have included ...

Strange toCharArray problem

595 byte By marksman@mail2world.coma at 2007-9-30 1:45:18
Hi, I am having trouble outputting a character array, here's the code:String input = "abcdefg";char letters [] = input.toCharArray();for (int a = 0; a < letters.length; a++)System.out.print(letters[a]);my problem is that this doesn't output anything however, when i change a to initially ...

Can applets talk to each other?

210 byte By apchar_boiira at 2007-9-30 1:45:20
Lets say I have 2 applets on 1 web page. Can one execute a method in the other andread back the results. I know it can be done through javascript. Is there a more directroute?Thanks.

dos compiling

74 byte By reem_sabrya at 2007-9-30 1:45:43
can i compile a java file on a pc without installing jdk on this pc

5 dukes up for grabs

302 byte By KhanWazeeria at 2007-9-30 1:45:56
K guys 5 dukes goes to the best example anyone can write.I want code for a JFrame in which you have a JPanel displaying a picture and a JtextFieldEverytime the User clicks on the Picture the pixel color or RGB value is displayed in the Textfield of the particular pixel clicked ...

5 dukes up for grabs

302 byte By KhanWazeeria at 2007-9-30 1:45:57
K guys 5 dukes goes to the best example anyone can write.I want code for a JFrame in which you have a JPanel displaying a picture and a JtextFieldEverytime the User clicks on the Picture the pixel color or RGB value is displayed in the Textfield of the particular pixel clicked ...

how to get my exe file

224 byte By reem_sabrya at 2007-9-30 1:46:04
after having a anyclass.java & anyclass.class how can i use my program in any computer even if this computer dosen't install sdk or any thing about java . how can i take it to any where i go?how to make exe file?

Need a little help.

89 byte By blackieula at 2007-9-30 1:46:14
What does a java.lang.NullPointerException mena and what would cause it to happen?

Confusing over super.paint(g) and super.paintComponent(g);

1243 byte By LittleRedOnea at 2007-9-30 1:46:22
Hi,I have an app with a GIF as a backgound, added as:Icon icon = new ImageIcon ("blah.GIF");I am painting dots and lines connecting the dots onto the extended JPanel using paintComponent().Of course without a call to super.paint(g); or super.paintComponent(), when I resize the window my line ...

This should generate some "ink".

342 byte By grand_poobaha at 2007-9-30 1:46:27
Hello again world.Often times in the literature, when Java is compared to the C language, the writer will emphasize the fact that Java does not use pointers.At the risk of getting my '/as\{2\}/' chewed out, it seems to me that a non-programmer might say, "Yes they do, they just call it ...

graphs

83 byte By blackieula at 2007-9-30 1:46:28
How would I go about changing the width of the actual line drawn in a graph?

how to import other class?

306 byte By milong1812a at 2007-9-30 1:46:34
Hi newbe here, how to import other class from other java program?I tried:let's I have a java program a.java(class a)In my program b.java, I would like to import aI type:Import a;while I compile the program, it prompt : a does not ...

dos window in applets?

91 byte By xytora at 2007-9-30 1:46:36
how do u put the dos window that all the output normally appears in, into an applet?

Menus

62 byte By cjo_78a at 2007-9-30 1:46:56
What's the difference between a JComboBox and a JList?

blank output

845 byte By apcssa at 2007-9-30 1:47:16
hi ppl, i'm doing a linkedList program which should insert values in order..my insert code:public void insert(int id, int inv){ ListNode pos = null , back= null;Object value = new Item (id, inv); if (size == 0) first = last = new ListNode(value, null); else pos = first; while ...

"unclosed string literal" errors

1874 byte By bluey_the_puncha at 2007-9-30 1:47:18
I keep getting "unclosed string literal" errors when trying to compile the following code.There is obviously something about my MySQL statements that Java doesn't like,but i can't seem to structure it in a way that java find it acceptable. Can anyone tell me where i am going wrong?public void ...

Applet aol.htp.common.ui.HtpMain notinited

182 byte By LLovingMoma at 2007-9-30 1:47:45
I just got a new computer and now I can't update any of my preexisting home pages.This keeps coming up and won't let me go to any page builders. How can i fix it!!?SB

Java Programming for Class using Macintosh?

489 byte By kkirlesa at 2007-9-30 1:47:58
Hi- I am very new to Java and am currently taking a course for school... My assignments are to create a .java, a .class and a.html file for each lab. The link to my class is.... http://www.cs.iupui.edu/~mroberts/n307/I use Windows at school, but then only have Macintosh 10.3 at home... I have ...

6 hours

4631 byte By bluey_the_puncha at 2007-9-30 1:48:06
No matter what I try, my Jsp returns a "NullPointerException" everytime I try and run it. Can anyone see where my problem lies?The methods that I am using and the jsp code are displayed below,public void roomsBooked(String arrivalDate, String departureDate) throws SQLException, Exception{if ...

Long to Int

362 byte By danbuga at 2007-9-30 1:48:07
I have been trying to use a random number generator to create graphics. The problem is that random retuns a double. I can conver that to a long, but then cannot convert it to an int. (int is needed for drawLines, etc.) I can conver a float to an int, but not a double. So, I need to convert a ...

REPOST: JSP problems!!!

4790 byte By bluey_the_puncha at 2007-9-30 1:48:09
Sorry about the repost,I have been trying to get my JSP to work all night but with no success. At the moment it outputs the total set of data which I presume means that my queries aren't being executed properly. They work fine when typed directly into MySQL. Can anyone see the problem?The ...

response into textfield

1977 byte By Hal@a at 2007-9-30 1:48:20
HelloHow do I prompt for a response into the text field YourguessField?thanks for any help!import java.applet.*;import java.awt.*; import javax.swing.*;import java.awt.event.*;public class GuessAgain extends JApplet {// graphical user interface componentsJLabel YourguessLabel, correctLabel, ...

What Operating Systems does...

197 byte By highland_lada at 2007-9-30 1:48:45
What Operating Systems does java run on ? I have been looking about for some sort of list but couldnt find one. It is just out of interest.Does anyone have any idea ? Thanks :)

How to make an .exe-file with Java?

1149 byte By DoctDooma at 2007-9-30 1:49:24
Hi, brothers.I hope that my following question doesn't sound stupid to you and also I hope that you will not get mad because of the comparison I'm gonna make with another programming language.In C# and Visual Basic I nodest that those programs can make .exe-files of a program written in that ...

Porting from an exotic programming language to Java

742 byte By Nediara at 2007-9-30 1:49:46
I'm working on a project using the Mozart development platform ( http://www.mozart-oz.org). It is a wonderful platform for rapid prototyping and research, however it's very hard to sell the final product of our research (a middleware) to the industry. So we would like the investigate how we ...

help again please

618 byte By m0nster_zeroa at 2007-9-30 1:49:48
hey guys. i have yet another java question. i'm just starting this whole java thing so i'm a little slow at it. i was just wondering how you would write a while loop that would make message boxes pop up. as in... let's say the user wanted to enter a number, then that many input boxes come up ...

Help

212 byte By StephenBarrett1850a at 2007-9-30 1:51:00
Can someone please tell me how to fix this line i know whats wrong with it in that im trying to make an object = to a string any help would be appreciatedString Queue = jComboBox3.getSelectedItem();

Help (Chars and returns)

498 byte By David_Miguela at 2007-9-30 1:51:03
I need some help in 2 questions, thanks for your posts!1. Can I join 2 or more chars in a string?2. Can I return a array, like this?double[ ][ ] returnarray(){return darray[ ][ ];}When I try it gives-me this error:DynamicArray.java [44:1] '.class' expectedreturn darray[ ][ ] ; ^Thanks for ...

how to make an array list?

346 byte By xytora at 2007-9-30 1:51:06
i have heard that you can make an array of objects, whose length is not defined, for example, you can add and remove parts of the array at leisure.this is usefull if you have an array of objects, and it will probably change during runtime.how do i code this "array list"and can i replace my ...

classpath ! ! !

612 byte By delibena at 2007-9-30 1:51:08
Hi,this is my very first day in the world of Java. I have downloaded the j2sdk1.4.2 with net beans IDE 3.5.1and installed it correctly to a diffrent local drive as suggested.I now hardly try to set the classpath but somehow it does not want to run . How do I set the classpath for the sdkTools ...

floating point rounding

482 byte By patyorka at 2007-9-30 1:51:13
Ok this is a stupid noobie question but when I have a floating point it gives me alotmore digits than I require.for instance I want the value 0.12 but I get 0.11999999.So in my for loop it jumps out 1 iteration earlier than I wouldlike because the condition in the for loop states <= and ...

Extracting a .java file from a .class file.

318 byte By grantm_browna at 2007-9-30 1:51:30
Ive got some java files that Im running in an IDE. The class files run perfectly, but I cant compile the .java files after trying to add a bit of extra funtionality. I was wondering of anyone new how to extract the original java file from teh class file so I can compare and sort out what Im ...

Ball drags with Swing

4026 byte By smeagol23a at 2007-9-30 1:51:37
I am attempting a simple ball animation. When it is drawn in a conventional applet it is OK but when in a JApplet, the ball is like a snake with the head moving upwards and every ball that is drawn staying where it is. Does anyone know why this happens and how I can fix it?you can view the ...

InputStream

62 byte By johnny_FLa at 2007-9-30 1:52:35
Can anyone tell me how to open a file with InputStream?

DataStructure for storing resultset

229 byte By solutionseekera at 2007-9-30 1:52:37
what datastructure in java can I use to store the resultset obtained using jdbc ... if the resultset has a number of columns that I want to store. Then use that datastructure again with another resultset to change stuff..?

UDPClient (Continued from before)

5855 byte By solutionseekera at 2007-9-30 1:52:40
Hi Jverd and Bsamp.. You were both helping me with this and I think its finally done ... so I wanted your suggestions and see if you have anything to say about this.. UDPClient looses about 15% of datagrams in the process of transfer and since I have a 1 second timeout its taking about 15 ...

How do I paint a pixel?

89 byte By plassna at 2007-9-30 1:52:43
I want to paint a pixel only. How do I do this without using the drawLine-method?

Detecting if a String is null

127 byte By patriveta at 2007-9-30 1:53:10
Hello,is there a way to find out a way if a String is null without getting a null pointer exception?Cheers

how i can get exprence in java?

273 byte By Rashid--Chohana at 2007-9-30 1:53:12
Tell me simply that how i can get exprence in java, I am very crazzy to get experties in java , but how i can do it? I know some about java and also develop the project using java, but i want to learn it and understand it at professional level. so what the good way?

persistant socket?

2156 byte By MRjavajeffreya at 2007-9-30 1:53:25
Hi,I would like to create a client socket in one of my methods, send some stuff, then have other methods be able to access the socket. I have code similar to this://class member variablesprivate Socket CommSocket = null; //the socketprivate BufferedReader in = null;//to read Strings from that ...

Tree's in Java

538 byte By Cowardicea at 2007-9-30 1:53:30
I need a datastructure that can store an object, and then point to 0-4 other objects. Sort of like a Linked List, where each one points to the next, except I need each one to point to up to 4 other ones. I think those things are called Tree's, but the only ones I can find are JTree and ...

ResultSet appearing null

432 byte By patriveta at 2007-9-30 1:53:46
Hi,I have an issue with a resultset that contains, lets say 3 results, when I refer to it from outside the object that originally created the ResultSet, it loses the contents, the 3 results no longer exist.Even if i pass the resultSet to the class I call it from, it finds null. Not sure if this ...

Filenames as Command Line Arguments: How?

543 byte By Mr_Carla at 2007-9-30 1:53:47
i need to create a program that involves taking in a file name as command line argument, reads the file and then displays its contents on the screen. it needs to work with any file with a .txt extension.The only thing i dont fully understand is how to read the file name as a command line ...

GUI and Problem Domain

1617 byte By rbutler02a at 2007-9-30 1:53:53
I have a class assignment that does this: ask the user for the productID, price, qty and tax. We're supposed to put the business logic (ex., calculating subTotal) in the problem domain tier with regards to three-tier design.The example my instructor gave me to test this project is not working ...

pherhaps silly question, but for me...

388 byte By galileo5a at 2007-9-30 1:54:03
I really don't know anything about all the things that you guys talk about.I just want to know 1 thing. I had to install java or else a program wouldn't run, and now every time that I close my computer, I am asked to first close down Java. Why is that, is there a way, that it won't ask me ...