error with ArrayList converting! urgent!

1240 byte By mo_ali1a at 2007-9-30 2:07:22
hi, thanks to yawmark he helped me do the followingget a set of dataand get a subset of dataand minus the two where the data will get values that are not in the subset but in the subset..it gives the following error!Incompatible type for method. Can't convert java.lang.String[] to ...

File Transfer using FTP

134 byte By sellamuthu_deivasikamania at 2007-9-30 2:07:24
How can i transfer the file from linux machine to windows machine using FTP protocol. Please send the java source code for that

package/interface/class

258 byte By Talal_Sa at 2007-9-30 2:07:39
hi people,i'm having some trouble figuring out the differences between package, interface and class..I believe that a package contains interfaces and classes, but what's the difference between those 2? who do all these 3 relate?thanks.

perform Content Based Search using Java API

191 byte By bala_excela at 2007-9-30 2:08:39
HI all,I want to perform content based search in a word document . I want to know whether it is possible to do it by using a java API. Thanks in advancebala

calling another java file

277 byte By blackieula at 2007-9-30 2:09:00
I have a main class ( packet.java for example) and I need to call another file (filter.java) to display a dialog box. Both files are in the same package, but all I want to do is when a button is clicked in packet.java, I want it to display the dialog box in filter.java.

Anyone Know what this means

163 byte By StephenBarrett1850a at 2007-9-30 2:09:27
Note: C:\Documents and Settings\X\.netbeans\3.5\sampledir\Main.java uses or overrides a deprecated API.Note: Recompile with -deprecation for details.

Java applets

235 byte By Mark_08a at 2007-9-30 2:09:39
Hi, i'm new to Java and have an assignment to do on Java forms. What are some common uses of Java forms with say buttons set out in border and gridlayout formation, a text field and label boxes?Any help much appreciated.

random numbers

3170 byte By Talal_Sa at 2007-9-30 2:10:04
Hi,Could anyone please tell me how I can generate a random number? I'm trying to learn about threads and I would like to have 2 threads running..one keeps generating random numbers, and the other would call to get one every 5 seconds for example...here is what I have so far:import ...

can't draw on jPanel

656 byte By jac19a at 2007-9-30 2:10:15
I can draw on a jPanel with a border layout with this code in the initialization:jPanel1.add(new DrawCurve(), "Center");jPanel1 is the first panel put the this container generated by a jApplet.Now if I change the jPanel Boderlayout to null and add a jPanel with a Borderlayout and try to paint ...

SQL Problem

707 byte By StephenBarrett1850a at 2007-9-30 2:10:28
I have a problem with the sql statement as shownString sql = "SELECT Count(Accepts.Queue) FROM Accepts WHERE Accepts.Queue = '" + Queue + "' AND (Accepts.TimeOfAccept BETWEEN('"+ Start_Date +"') AND('" + End_Date +"'));";The problem is that there is a Data type mismatch in criteria ...

Adapting My Word Counter Program to also Search and Replace

1154 byte By maxsoila at 2007-9-30 2:10:47
Hi,I recently completed a word counter program for a school assignment. It reads in a file name from the command line and prints the contents to the screen before counting the number of words. i now want to try and adapt this program to also search for and replace a word specified by the user ...

interview questions

273 byte By chaituua at 2007-9-30 2:11:11
1)Difference between Rowset and ResultSet2) CallableStatement cstmt = con.prepareCall (齝all proc add (?,?,?)?;If I give input value to 1st question mark to 10 and 2nd one to 20 I want output of 1st one and 2nd one to 3rd one; how will u achieve in jdbc

when should i use abstract class and when i should i interfaces

311 byte By chaituua at 2007-9-30 2:11:17
when should we use abstract classes over interface or vice versa;i am getting this question regulary;how should i give proper answer. whatever methods we define in abstract class same thing we can do in interfaces;so what we can achieve with abstract class;with ...

synchronization

187 byte By chaituua at 2007-9-30 2:11:20
hi,if synchronization keyword it will degrade the performace thenhow will i improve performance when i use synchronization in methodsbyechaitanya

How can I clear a JTextField/JTextArea after input?

310 byte By Aerina at 2007-9-30 2:11:45
I have a form like frame with text areas and fields, but was wondering how I could "clear the form" for a new round of input after the first time. I have been trying to locate something in the API or tutorials but haven't found something yet about how to clear a field/area. Thank you very ...

Trying to create a class method

851 byte By festa74xa at 2007-9-30 2:11:47
I'm trying to create a class method that passes two instances of class "purse" and then return which "purse id" (called license) has more money...but I'm getting an error that nothing is retuned...any help would be appreciated!!!note: this is only the relevant ...

Inserting more than one record

1124 byte By SullyBluea at 2007-9-30 2:11:48
//Adds customer record to database. public String addCustomer(Customer c) {try {// get the connectionClass.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection myConnection = DriverManager.getConnection( "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\\myproject\\db1.mdb");Statement ...

AscII

116 byte By kazhaa at 2007-9-30 2:12:08
Hy.How i must point string, that i want there to put , for example, ascii symbol nr 5. ?Kazhha.

Is it my problem?

132 byte By eljima at 2007-9-30 2:12:14
Hi there,Can you access java.sun.com with NS7.1?I can access it with mozilla.Thank you,JB

a general question

584 byte By grand_poobaha at 2007-9-30 2:12:16
Hello again world.During the course of my reading, I have finally grasped the idea that "everything in Java is either an object or a primitive data type."* No sooner do I grasp this concept that I notice, often times, a distinction is made between three broad catagories of representing data - ...

dukes ur way, need code for a good background

341 byte By Rambotangoa at 2007-9-30 2:12:26
Sir/Madam,I am working on an application, and it has textfields and a buttons, i wish to paint something nice in the background any ideas. Well I checked something called gradient paint though i am still not gettiin things work out. can you get me some small code for , gradient from one color ...

Coming from C++: "friend" classes?

452 byte By wad@acm.orga at 2007-9-30 2:12:31
In C++ a "friend" class is one that is priviliged to see the private and protected stuff. I'm writing some test code for some classes, and I realized that I don't have any "friend"-making capabilities. ;)What's the accepted way to get into stuff that the public isn't allowed to get into, ...

how to set up an array of session variables

1116 byte By coach-xa at 2007-9-30 2:12:42
I have a sql query that returns four rows, I can store one row (last row) into a session value using while (rs.next()) {session.setAttribute("column_one", column_one);session.setAttribute("column_two", column_two);session.setAttribute("column_three", ...

Mode Mean Median

2090 byte By rs6s4a at 2007-9-30 2:12:45
I need help with posting the mode. Can anyone help?Here is what I have for most of the code, I just can't figure how to write the mode part.Thankspublic class Homework8 {/** Creates a new instance of Homework8 */public Homework8() {}// # 8.30public static double mean(int []a) {double ...

Format Help

1200 byte By rbutler02a at 2007-9-30 2:12:50
I have two classes, Order (my problem domain) and OrderDriver (my driver). Within this OrderDriver I'm calling some custom method from my problem domain class. One of my problem domain method is a getPrice method.When I try to format an output to the system.out.prinln method I can't figure ...

add Integer obj to vector

1179 byte By solutionseekera at 2007-9-30 2:12:53
int currentClassCode=0;Vector ClassVector = new Vector(1);while(rsClass.next()){ ClassVector.addElement((Integer)rsClass.getInt("class_code"));}rsClass.close();int currentClassCode = 0;for(int i = 0 ;i <= ClassVector.size(); i++){ System.out.println("Vector size "+ClassVector.size()); ...

distribute my program

323 byte By virtualacera at 2007-9-30 2:12:55
I am big-time newbee. I had one class on Java but we never got into how to distribute our programs. I developed a very simple program in Borland JBuilder but I am completely clueless as to how the program can run on other computers. If anyone knows how to do this from JBuilder it would be ...

Parse text file and retrieve data

582 byte By AnupmaManglaa at 2007-9-30 2:13:04
Hi,I have a log file with comma separated entries in each line. Each line has about 50 or more integer values logged for statistical analysis. What i need to do is to be able to parse this text file Line by line and retrieve data say nth entry in each row of file. Basically, like i need a ...

How do I find one string inside another?

665 byte By wad@acm.orga at 2007-9-30 2:13:09
I've been looking through the documentation, but have yet to find what I need. While I keep looking, maybe someone here has a good idea...I have a TreeSet of Strings ts = { "foo", "bar", "green car" }, and another String s = "this is my new green car". I need to identify which Strings from ts ...

I'd like a "goto" like in my method

2609 byte By newonthisa at 2007-9-30 2:13:46
here's my code:bl = true;do {// apresentar o problematry {System.out.println(p1 + escolhido.getOperacao() + p2 + " ?");}catch (NullPointerException npe) {System.out.println("Escolha uma operacao valida!");}try {// ler a respostaString input = ac.getResposta();//tem de estar aqui// converter em ...

problem with synchronizing threads

4558 byte By gwaissa at 2007-9-30 2:13:48
I am trying to to run multiple ssh commands using j2ssh. I create multiple Threads and then kick them off. The problem that I'm having is I keep getting this error: com.sshtools.j2ssh.transport.TransportProtocolException: The connection did not completeat ...

Seeking inspiration

1091 byte By MrKangarooa at 2007-9-30 2:13:52
Firstly, a very warm hello to all the regulars on these forums. I have been reading them for a while but haven't posted anything of value yet. I find that most questions have already been answered in other threads.The reason behind this post is that i am a hobbyist programmer (until i start a ...

Imbedding Applets in a Swing Window

395 byte By LHSPomPoma at 2007-9-30 2:13:54
I am working on a project for school and I was curious as to know whether or not there was a way to imbed applets into a swing window with buttons and whatnot as opposed to including swing components in an applet. This is necessary because applets cannot read or write to file, which is ...

Classes

701 byte By grand_poobaha at 2007-9-30 2:14:17
Hello again world.I've noticed several times in my reading the following logic.First a class, which extends a class in the API, is declared:public class NewClass extends SomeAPIClass {}Then, somewhere else, an object is instantiated like this:SomeAPIClass objectName = new NewClass();What is ...

how to create a database?

261 byte By rskurtza at 2007-9-30 2:14:29
what is a simple way to generate a database of 125 records with 80-character sequences in each record that contains the letters a, b, c, d 80 times in random order in each record... i cant seem to figure out how to get this right... anyone have know how?

Big long mess help me out

12984 byte By plasticmonkeya at 2007-9-30 2:14:30
Objective: Develop a java application that reads student and instructor inputs from the dos console and allow the user to query the data.So, I gotta have a menu with 6 options: add instructor, add student, display all instructors, display all students, group students by instructor, and ...

percent..WHY!

263 byte By mo_ali1a at 2007-9-30 2:14:44
hithis litlel bit of java returns 0.. why?int total = length; int percent = ((score/total) * 100);percet always turns out to be 0 even though the values do exist....length has a value and score has avaluewhy

Problem with renameTo function

499 byte By Simon_SM_Sundera at 2007-9-30 2:14:47
Hello !I hava got a problem on renameTo function. I can rename the short file name (for example: REPORT.TXT to REPORT.ERR), but I can't rename the long file name (for example: XXX_REPORT_20040125.TXT to XXX_REPORT_20040125.ERR). The following codes I have been used :{File f1 = new ...

Array

272 byte By sbarrow60a at 2007-9-30 2:14:54
Can I use this code to add students to an array while assigning each student a value the same as it齭 index? student = new Student("John", 10, ,'M');stu.add(student);

Looping issue (I think)

7286 byte By wulfkuba at 2007-9-30 2:15:04
Ok, odd problem here. The code all works, all the classes and methods execute...However, when one uses Case 2 (the method to add a word to the dictionary) the program will not reprint out the instructions in the command line to ask the user what they want to do next but it will reprint the ...

Cant re enter loop

733 byte By newonthisa at 2007-9-30 2:15:11
here i go againi add this 'break' so that my app works ok, but that's not what i wantWhen user enters other then '+' or '-', a NPException is thrown. I'd like to know how i can handle that in a way that, when user enters any other string, the app re enters the loop at the beguining of ...

novice extremly stuck!

875 byte By mo_ali1a at 2007-9-30 2:15:18
i have the following mysql table CREATE TABLE student_test (stu_test INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,test_id INT UNSIGNED, test_name VARCHAR (50),email VARCHAR (30),reg_no INT UNSIGNED,score INT UNSIGNED,date DATE);and the following statment:addStudentTest = ...

why isnt this printing ?

3133 byte By DSM4Lifea at 2007-9-30 2:15:19
this doesnt print anything but blank with NO complie errors, its simple code but not printing for me :O(import java.io.*;public class HistoryTest{public static void main(String[] args) throws IOException{BufferedReader infile = new BufferedReader(new FileReader("a:\\Input.txt"));PrintWriter ...

Regex: how do I capture this?

130 byte By correroa at 2007-9-30 2:15:30
Hi! How do I capture the following pattern using regex:&lttag something <taginner something> something>

Quite useful

30 byte By UlrikaJa at 2007-9-30 2:15:43
http://javaalmanac.com/

Private inner classes

374 byte By wclap1a at 2007-9-30 2:15:47
This isn't an important question but I just wondering... if I have a private inner class, is there a point to make the instance variable private/public? Logically I don't see any use making my data private. Constructors look weird to me without a 'public' in front of it.See... this topic ...

Arrays and garbage collection

259 byte By Tecciea at 2007-9-30 2:16:14
Hello,I have a program that reads an XML file into an array. When I want to load another file, do I have to de-allocate the array first? Or can I just create new a new array in the old variable, and the garbage collector will clean up the mess?

what is wrong with this code?

848 byte By Java_Begina at 2007-9-30 2:16:17
Hi i am trying to practice some swing, if i try to compile my program it is showing error sayinng:java:32: local variable btPlay is accessed from within inner class; needs to be declared finalbtPlay.setVisible(false);what i have to declare final and how do i declare it?here is the ...

Contest: Guess whats wrong with this code!

560 byte By Karl_XIIa at 2007-9-30 2:16:19
Can you guess whats wrong with this code snippet? Perhaps its too easy... private void clearDefaultTableModel( DefaultTableModel dtm) {int rowCount = dtm.getRowCount();for(int i =0; i < rowCount; i++) {dtm.removeRow(i);} }- Karl ...

What is the best online tutorials on Java?

110 byte By veryNewInJavaa at 2007-9-30 2:16:28
HiI just started java and would like to know best online tutorials for beginnersthank you