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
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 ...
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 ...
Can any one suggest some good books to start learning java?
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 ...
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 ...
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
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 ...
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 ...
{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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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?
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 ...
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]
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, ...
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 = ...
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 ...
to create constants in java we use final key wordam i rightbut we use static final not just final to create constantswhy ?
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 ...
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 ...
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
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 ...
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 ...
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 ...
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?
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 ...
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 = ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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) || ...
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?
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: ...
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.
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 ...
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 ...
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 ...