String to InputStream. How do I convert it?

111 byte By correroa at 2007-9-30 1:59:43
I have a String object, and I want to create an InputStream object out of it. How should I do it? Thanks

XML - Call by reference

3661 byte By Tecciea at 2007-9-30 1:59:54
Hello,I've got a problem with my SAX XML parser. I'll describe what it should do first...First, the XML file will be parsed once to check how many </matchitem> tags are found, to determine the amount of matchItems. Then, an array of Matches will be allocated using the size found by the ...

Positioning items in a frame

2027 byte By Young_Javamana at 2007-9-30 1:59:56
Can someone help me move the AM in my program so that it appears under the time. Also, does anyone know how to put zero,s on the clock when you have single digit numbers, e.g 10:01:03 instead of 10:1:3. Thank You!import java.io.*;import java.awt.*;import java.awt.event.*;import ...

How to start learning?

66 byte By SimpleBooma at 2007-9-30 2:00:15
Can any one suggest some good books to start learning java?

How can i read in two files! Please can someone help me!

2093 byte By Young_Javamana at 2007-9-30 2:00:26
I am having a problem with this code. Althoug it works when i read in just one file i need it to read in two(both marks1.txt and marks2.txt) and perform the operation on both of them. Can someone help me?import java.io.*;import java.text.*;public class Marks{static PrintWriter screen = new ...

how to read the second line in a .txt file with bufferedReader?

556 byte By Skariboua at 2007-9-30 2:00:43
hi,i am not the best in speaking english and programming java :)so, just try to make sense of my question:Im using a BufferedReader to read a .txt file. the .txt file has 5+ different lines, and each line has 6 tokens (separated with ; )My java file has 6 textFields and each textfield is filled ...

getting the Image out of a graphics-context

193 byte By Serethos_0a at 2007-9-30 2:00:50
if i have a "Graphics g" context, how can i get the drawn image and store it in a new one.im searching for a method like :>>Image img = g.getImage(); << as pseudo code

Printing Document

2230 byte By JosephCTSa at 2007-9-30 2:00:57
I want to print a .txt file using my java program.For that I wrote one simple program..import javax.print.*;import javax.print.attribute.*;import javax.print.attribute.standard.*;import javax.print.event.*;import java.io.*;public class ExamplePrint{ExamplePrint(){}/*public static void ...

ComboBox clicked procedure gets called when not wanted

1199 byte By jac19a at 2007-9-30 2:00:59
I use a combobox that when clicked executes some procedure. The problem isthat when I initialize my applet I want to set certain features of thecomBox like select an item to be executes, this causes the ComBobx clickedprocedure or ItemStateChanged to be executed which produces a logic error ...

Help with an sql statement

902 byte By StephenBarrett1850a at 2007-9-30 2:01:33
{String Queue = jComboBox3.getSelectedItem().toString();String Start_Date = jComboBox2.getSelectedItem().toString();String End_Date = jComboBox1.getSelectedItem().toString();int bins []= new int [size];String sql = "SELECT Count(Accepts.Queue)FROM Accepts WHERE Accepts.Queue = 'Queue' And ...

Reading the contents of a file into a String

580 byte By bbbubbbaa at 2007-9-30 2:01:35
Hello everyone,I'm sure this has been asked before...but I can't easily find the answer in a forum search. Writing to a file seems very straight forward, I just use FileWriter.write(String). Unfortunately, reading from a file seems to be a little more obscure. I read the "Overview of I/O ...

Object Deserialization help?

7565 byte By RageMatrix36a at 2007-9-30 2:01:37
Hi all, Once again I am forced to offer up my programming efforts for professional advice. :) I'm doing object serialization / deserialization. I have a very simple class called Person which looks like this: -public class Person implements Serializable {private String sName;private String ...

File Copy With JProgressBar

1081 byte By ak343a at 2007-9-30 2:01:41
Hi i'm using the below code to copy a file and display the progress on screen. However the file copies ok by the progressbar is never shown. Can somebody please show me how to use the JProgressBar Component to copy a file and show the progress?ThanksArlefpublic void copyFileToMediaFolder(File ...

DocumentListeners and .getSource()

810 byte By Jedimarka at 2007-9-30 2:01:44
When using ActionListeners you could, in its ActionEvent method do code like:if (e.getSource == cmdExit) {// do something}Is there a similar way of doing this with DocumentListeners?I get the following error if I try:C:\DOCUME~1\Mark\MYDOCU~1\Work\SOFTWA~1\jdbc\src>javac *.java -d ...

Interal Windows

777 byte By Tim_Christophera at 2007-9-30 2:01:45
Hi,I'm trying to create an application that has multiple internal windows; sort of like how you can several Word documents open at once within one instance of MS Office.Currently when you maximize a window it keeps the bar at the top that contains the minimize, maximize and close buttons (in ...

Help wih JDBC-ODBC

1095 byte By SullyBluea at 2007-9-30 2:01:58
I'm currently learning how to use JDBC. And have been doing an example. Now I have come across a problem which I can't resolve. So this is the code and the error that gets caught: public String addCustomer(Customer c) {try {// get the ...

Something Stupid

358 byte By StephenBarrett1850a at 2007-9-30 2:02:22
public boolean IsleapYear (int Year) {boolean LeapYear;if (Year %4 == 0) LeapYear = true;if (Year %100 ==0 ); LeapYear = false;if (Year %400 == 0); LeapYear = true;return LeapYear; }Main.java [388:1] illegal start of expressionAny one know the legal way of doing ...

creating new array

314 byte By mo_ali1a at 2007-9-30 2:02:37
hii have an array array 1 and array 2i want the create an array where the size is the difference between the twoe.g array1 = [ 5]array2 = [10]array size should be 10always 2 will be bigger or equal to array 1...array1.length - array2.length dosnt ...

Need a little help here

1027 byte By introublea at 2007-9-30 2:02:39
Wondering if i could get a little help as im new to this game but trying to learn it to be up to speed with the technology. following a book tutorial i have to create a chessboard using the JSwing applicatoion and so on. but i cant seem to begin..I want toocreate a subclass of Swing's JButton ...

Design Architecture of this process

1714 byte By solutionseekera at 2007-9-30 2:02:47
May be this is too huge a problem to post... But its interlinked and I cant post it seperately...(I need to figure how to do it looking at the big picture.. like get from database and use datastructure and how to do it best)I am trying to equalize the overtime (If I you and I are programmers ...

SQL elements int an array?

2421 byte By eddiemjm123a at 2007-9-30 2:02:50
I want to get the names from each record in the following table and store them in an array according to their club.The database looks like this:PlayerIDPlayerPositionPlayerFirstNamePlayerLastNameClub1GKSTaylorARS2GKJLehmannARS3GKSPostmaAV4GKTSorensenAV5GKNVaesenBIRclass GetPlayersFromDatabase ...

what's the answer... 5 dukes...

265 byte By bsampieria at 2007-9-30 2:03:00
Since it's Wednesday (in the eastern US at this time, at least), and I want to give away my last original dukes (the ones you get free for signing up), here's 5 dukes for whoever can give me the right answer:How can I find the answer to my question?

Quick Question on Arrays.fill() Method

832 byte By Aerina at 2007-9-30 2:03:23
Does this work for a multidimensional array? I've tried and I can't get it to. double stuGrade[][];stuGrade = new double[3][125];Arrays.fill(stuGrade, -1); //Have also tried Arrays.fill(stuGrade[][], -1) error: Cannot resolve symbolsymbol: method fill (double, int)Have imported ...

extensible 2 dimensional arraylist required

166 byte By vik_paa at 2007-9-30 2:03:31
how do i specify an extensible 2 dimensional arraylist i.e. i dont want to specify the size ArrayList ar = new ArrayList[2][2]

storing value of arrays in new one.. (minus)

918 byte By mo_ali1a at 2007-9-30 2:03:51
what im trying to do is get values of check boxes.. which are intgers in my jsp...only the values which are selected will be returned, which is a problem...trying to use the two array values and get the difference between the two in a new onei have also an array of the entire value selection, ...

package problem

1625 byte By adamwachtela at 2007-9-30 2:03:53
Hi, I'm trying to create a package, using the following code:DBConn.java...package test;import java.sql.*;public class DBConn{private Connection connect;private ResultSet resultSet=null;public Connection getConnect(){try {Class.forName("org.gjt.mm.mysql.Driver");connect = ...

Help on standard deviation please

1711 byte By sbarrow60a at 2007-9-30 2:04:09
I am writing a program to find standard deviation. Below is what I have so far "not much I know" but I have tried so don't get flame happy. It errors out and I have tried to fix it. I know the formula for standard deviaition but I can't seem to program it right. I also need to program the ...

constants

175 byte By ambharisha at 2007-9-30 2:04:16
to create constants in java we use final key wordam i rightbut we use static final not just final to create constantswhy ?

a question concerning import

504 byte By Talal_Sa at 2007-9-30 2:04:40
hello people,I have the following question:In the Java SDK folder, there is this file src.zip, I unzipped its contents in the same Java SDK folder and so I got a lot of folders containing all the different classes which come with the SDK. now the question is, do I have to put them in a ...

NullPointerException case: dont Know why

487 byte By newonthisa at 2007-9-30 2:04:52
i'm puzzled with this bit og code:do {System.out.println(p1 + ac.escolha().getOperacao() + p2 + " ?");System.out.println("getoper " + ac.escolha());//outputs nullthe first time i print ac.escolha() worksthe second time, just in the next line, ac.escolha() prints...NULL!!!dont get ...

Print from file

251 byte By bolalaa at 2007-9-30 2:04:55
I have a file names.txt and i have a few names in it like this:mike;tony;james;....henry;I want to read and print them all out without the ';' after the names. please help me.Thanks guys

how to import a java class in a JSP

745 byte By Sangitava at 2007-9-30 2:05:04
Hi All,I have a java class file called myTest.class (i made after compilation of myTest.java). I have a JSP page that uses this java class file.These 2 files are in same folder called c:/testand iam importing this java class file into my jsp file and that too at the start of this jsp ...

coding question

1465 byte By Talal_Sa at 2007-9-30 2:05:07
Hi all,I would like to know what's the difference between the following two listings:public class Connect {public static String myString;public static void main (String argc[]){myString = "hellllooooooz";System.out.println("the string is: " + myString);}}and public class Connect {public static ...

Cannot download J2SE 1.4.2

342 byte By cc2004a at 2007-9-30 2:05:10
I cannot access java.sun.com yesterday. Today, I can access java.sun.com but cannot download J2SE 1.4.2. When I clicked "Download", it said webpage cannot be found. Can anyone give a comment on what is going on? or just tell me where can I down load J2SE 1.4.2 except ...

Anti-virus

132 byte By bolalaa at 2007-9-30 2:05:21
Has anyone seen an anti virus written in java? I was wondering if it possible to write it in java...What do you think?

Placing Fields in Window

336 byte By reyes99a at 2007-9-30 2:05:41
Hi Everyone,I am new to java and I am trying to create a window where I can enter an address. I could not figure out how to place the JTextFields where I want to. This is how I want to place them.NameAddress1Address2City, State ZipPlease help?Thanks in ...

preparedStatement and Date probs!

988 byte By mo_ali1a at 2007-9-30 2:05:48
hiim trying to add today's date in mysql, the column is of type TIMESTAMP(6), and when i try to inser the following newDate into it, it says "Column count doesn't match value count at row 1"whats wrongthe table has 7 columns and first one is autoincrement[code] Calendar today = ...

Confused!! JDBC Statement Problems

7823 byte By bluey_the_puncha at 2007-9-30 2:05:51
Can anyone help? One of my JSP's refuses to execute properly so I presume there is something wrong with the associated methods in my connector.java file. Everytime I try and run my JSP in TomCat it produces the error message "java.sql.SQLException: java.sql.SQLException: General error, message ...

Code Help!

1532 byte By sbarrow60a at 2007-9-30 2:05:52
Here is some code for a standard deviation program that I wrote. I am having problems displaying the values on screen along with the deviation. I get the output [D@2bbd86 for my inputed values display. In addition I would like someone to look at my code and give me some academic ...

java.lang.nullpointerexception

4166 byte By Spirit_Of_Atlantisa at 2007-9-30 2:06:01
Hi,When i compile my code all is well, untill i trigger an event when running the applet, thenerrors start appearing in command prompt...saying:java.lang.nullpointerexceptionat Opdracht6_2.adjustmentValueChanged(Opdracht6_2.java:35)at ...

Cases and Switches and Loops

6467 byte By wulfkuba at 2007-9-30 2:06:04
I have a small problem with my code, the code is supposed to open a file, read the file into a Linked List (essentially), and then ask the user what they want to do. Ok, so that all works all happy hunky dorey including getting the user to add a new word, to search for a word, and to print out ...

Javascript for web design?

359 byte By hellosamhia at 2007-9-30 2:06:11
Hello there, I have done some basic java programming, and I was told that you can use javascript to generate a web page. For example, those e-shopping crat, when you check some boxes, and then submit it, then it will bring up a page with the selected items. Could someone give me more ...

Code problem.....but its a C++ problem if you have any knowledge of it

8408 byte By bboyewala at 2007-9-30 2:06:13
basically the problem is ....when it outputs the result it doesn't show leading zeros, it should show the time.....like 3:30:10 and not 3:30:1 for instance.....i tried using the setfill('0') but can't seem to get it to work?....any ...

User Inputs Not Stored In External File

1475 byte By Kylenaa at 2007-9-30 2:06:19
I'm using the following code to store marksif (courseCode.compareToIgnoreCase(cCodeTerminate) != 0) { System.out.print("Enter your exam marks for " + courseCode + ": "); examMarks = Integer.parseInt(in.readLine()); //Loop to check if marks are within 0 and 100 while ((examMarks < 0) || ...

JAVA GUI Program

238 byte By Zenjavaa at 2007-9-30 2:06:25
I was wondering if anyone knows of a good GUI creation program thats in the freeware realm?Someone said that Netbeans could do this, but I havent been able to download it due to some site issues... so anyone know any others?

Help with a project

893 byte By neolithic15a at 2007-9-30 2:06:33
Hello, I'm currently working on a project for school and am drawing a blank on where to start. I'm in intro to java and our second project is to design the front and back end of an inventory tracker of sorts, the details of which can be found here: ...

kevljo est mort

76 byte By kevljoa at 2007-9-30 2:06:55
Thanks for all the help over the years. Time to find a good DB forum.

help help

716 byte By milong1812a at 2007-9-30 2:07:01
how to print results in several class into a file?I do have a class as below: public static void printToFile(String filename, Integer[] inNo, String header) throws IOException {// String filename = "output.txt";int value;FileWriter fw = new FileWriter (filename);BufferedWriter bw = new ...

Graphing Project

1471 byte By dwillynta at 2007-9-30 2:07:04
Hello,This post is more or less looking for suggestions from someone who has done a project similar to the one I am working on. I am making an application that takes input from a user and uses the input to query a database and then make a graph. I am looking for suggestions on the best way to ...

Plz help in exception handling

1554 byte By Java_Begina at 2007-9-30 2:07:17
Hello I am trying to do this exception handling in string to numeric conversion. Everything is working fine except when i enter any number with letters f and d on exception handling doesnt work like for example if i enter 5f or 4 d progam is working fine, but it supposed to show that it is ...