1,963 Posted Topics

Member Avatar for fardoonmuhafiz

[QUOTE=fardoonmuhafiz;1103922]That means defnitely Statement should implement ResultSet interface methods to return a ResultSet object[/QUOTE] No, Statement doesn't need to implement ResultSet: [CODE] public interface Resultset { // some methods } public class SomeResultSet implements ResultSet { // someone has implemented all the methods of the ResultSet } [/CODE] [CODE] public …

Member Avatar for javaAddict
0
85
Member Avatar for ryy705

You are not closing the prepared statement. Also you'd better post the entire code along with the loop and how you pass values to the statement as well as the query. I think there might be a better way to do this

Member Avatar for javaAddict
0
142
Member Avatar for jemz

There are the JProgressBar, JScrollBar classes that might be usefull to you. For better results, maybe you need to put one of them in a thread. One thread will do the loading and the other will display the loading bar

Member Avatar for jemz
0
103
Member Avatar for shiv0013

Check the classes: SimpleDateFormat, Calendar, java.util.Date Read their API

Member Avatar for javaAddict
0
53
Member Avatar for JBeginer7891
Member Avatar for jogendar
Member Avatar for Merosansar

CandidateList must be global. Every time you click something you create a new one, which is, of course, empty.

Member Avatar for javaAddict
0
104
Member Avatar for kring08

Check the internet for the definition of a magic square and then post some code

Member Avatar for javaAddict
1
198
Member Avatar for musthafa.aj

After checking the API you can use these methods: [CODE] table.setSelectionBackground(Color.GREEN); table.setSelectionForeground(Color.RED); table.setRowSelectionInterval(1,1); [/CODE] The setRowSelectionInterval selects the rows between the first and second argument. The above will select the row 1. And since you have used the setSelection.... methods, you see the pretty colors

Member Avatar for javaAddict
0
101
Member Avatar for musthafa.aj

[QUOTE=musthafa.aj;1099970]hello! i need to create JTable which swing string and animated gif image also... how to put animated gif and data(string) in Jtable cell dynamically... can you give any referel link or codes... i tried lot but vain...[/QUOTE] What have you done so far? [URL="http://www.daniweb.com/forums/thread251668.html"]http://www.daniweb.com/forums/thread251668.html[/URL]

Member Avatar for musthafa.aj
0
915
Member Avatar for gingerfish
Member Avatar for dorkwad

You cannot create a javascript application in java, because javascript is not java, it is javascript. You create javascript applications written in javascript. And the javasx.swing package is for desktop applications. It has nothing to do with the internet. I suggest to forget what you want to do for a …

Member Avatar for javaAddict
0
109
Member Avatar for Georgy1988

What do you mean when you say preview window? When you do onmouseover, you can take the src of that image and set it to some other image: [CODE] <img src="...." onmouseover="document.getElementById('[B][COLOR="Red"]target[/COLOR][/B]').src = this.src" onmouseout="" /> <img src="" id="[B][COLOR="Red"]target[/COLOR][/B]" /> [/CODE] For a complete reference: [URL="http://www.w3schools.com/jsref/dom_obj_image.asp"]http://www.w3schools.com/jsref/dom_obj_image.asp[/URL] The above link has …

Member Avatar for javaAddict
0
121
Member Avatar for jorgelex008

Look at API for the class JComboBox. There is a method called: getSelectedValue or something like that. It returns an Object. You can use that to get what is selected. If what is added in the ComboBoxes are Strings then you can cast the result of the above method to …

Member Avatar for javaAddict
0
7K
Member Avatar for deepakraj

If you have read what you just posted you would have seen that is says: d1.jsp:27 NullPointerException. At the above line you are using something which is null

Member Avatar for javaAddict
0
223
Member Avatar for NickT80

For overloading constructor: [CODE] private String Jazz; public JazzBandsInstruments(String p_Instruments, int p_Members, String p_jazz) { super(Instruments, p_Members); setJazz(p_jazz) } [/CODE] Apart from that does the code compiles? Make a list of all the requirements and check your code where they are implemented. If there is something you are not doing …

Member Avatar for javaAddict
0
78
Member Avatar for vicky9

[QUOTE=vicky9;1094996]in jsp,i created login.jsp. in login.jsp,i created username,password and submit button. my login.jsp goes through database. i am okie BUT i want validation in login.jsp which goes through database.[/QUOTE] Then create a method that takes as arguments the username and password and checks the database for the validity of these …

Member Avatar for javaAddict
0
78
Member Avatar for -ordi-

Why don't you use: startsWith, instead of equals. Of course that means that for these the methods will return true: 1234 12345 "12345".startsWith("1234") = TRUE 1 123456 "123456".startsWith("1") = TRUE

Member Avatar for javaAddict
0
96
Member Avatar for Shail011184

Create a JFrame with textfields for username and password. Check the API there is a class for passwords (JPasswordField I think) Use the getText methods to get the inputs, For the JPasswordField read the API. Then have a method that takes as arguments the username and password and returns true …

Member Avatar for javaAddict
0
128
Member Avatar for freesoft_2000

[QUOTE=ekalio;1097565]The thread is still on the server and is open, so anyone can respond. The answer will be helpful to those of the network the solution of that problem. Your comment is not smart.[/QUOTE] Respond yes, But give away the answer no. This is not a forum where the memebers …

Member Avatar for javaAddict
0
2K
Member Avatar for musthafa.aj

I haven't tried that before but my first guess would be this. If you see tha API for the JTbale model, there is a method called setModel that takes as argument a TableModel. Look at the class that implements that inteface: DefaultTableModel. The method addRow takes as argument an array …

Member Avatar for javaAddict
0
569
Member Avatar for JuicedBrain
Member Avatar for javaAddict
0
133
Member Avatar for P00dle

Also you are making the same mistake you did in your initial post. Remember, in order to print the text value of the node you are using this method: [CODE] System.out.println(node.getNodeName() + ":" + node.[B][COLOR="Green"]getTextContent()[/COLOR][/B]); [/CODE] So why are using this: [U][I]node.setNodeValue("")[/I][/U] in order to change its value? Use the …

Member Avatar for P00dle
0
190
Member Avatar for dansifh

[QUOTE=dansifh;1077030]I installed firefox days ago, and sometimes web pages can't open via it, the network is ok, anyone knows how to fix it? Thanks![/QUOTE] Hi, I have been having the same problem recently. The mozila was working fine, but then when the latest version was installed, I couldn't see anything! …

Member Avatar for Sell Online
0
268
Member Avatar for P00dle

Because [B]bold[/B] doesn't show very good try to add some color as well next time. Is this the line: Document doc = factory.newDocumentBuilder().parse(fileName) If yes the problem might be with the contents of the file. Also I noticed this: [CODE] public boolean writeToOldFile(String str_fileName) { str_jobName = txt_jobName.getText(); String str_settings …

Member Avatar for parry_kulk
0
194
Member Avatar for aakaashjois

The exception tells you where the error is: [B]at converter.main(basic_convert.java:20)[/B] You are calling Integer.parseInt with argument an empty String: "" As the exception says: [B]java.lang.NumberFormatException: For input string: ""[/B] Try to read it first before posting this entire, unrelated piece of code

Member Avatar for aakaashjois
-1
205
Member Avatar for rythman

Actually I was thinking something like this: [CODE] public double getSqrRoot( argument ) throws ArithmeticException { // code } [/CODE]

Member Avatar for javaAddict
0
44
Member Avatar for jemz

[CODE] Scanner scn = new Scanner(System.in); int i = 0; if (scn.hasNextInt()) i = scn.nextInt(); [/CODE] That is for reading from keyboard. Read the first number and assume that it is the max: [CODE] Scanner scn = new Scanner(System.in); int num = 0; int max = 0; num = scn.nextInt(); …

Member Avatar for jemz
0
104
Member Avatar for kevndcks

Inside the for you do this: [CODE] BufferedWriter bw = new BufferedWriter(new FileWriter("audits.txt")); String s = lines[i]; bw.write(s); bw.flush(); bw.close(); } [/CODE] Meaning that with each loop open the file, overwrite that was written and you close. You need to open the file, write whatever you want and when you …

Member Avatar for javaAddict
0
424
Member Avatar for teen-omar

I prefer the first method with the BufferedReader, with a small change: [CODE] public void readMethod() throws Exception { BufferedReader br = null; try { br = new BufferedReader(new Filereader("osaka.txt")); String strLine; while ((strLine = br.readLine()) != null) { System.out.println (strLine); } } catch (Exception exc) { throw exc; } …

Member Avatar for javaAddict
0
134
Member Avatar for JBeginer7891

First of all you need to close the connection, statement and resultSet every time after you have used them. Second try to print the stack trace of the exception. (e.printStacktrace()). And try to find at which line of the class you get that exception. If it is a NullPointerException, which …

Member Avatar for JBeginer7891
0
129
Member Avatar for billybobc

When you have a form with a servlet you have sth like that: [CODE] <form action="someServlet"> ... data to be sent </form> [/CODE] For a link: [CODE] <% String name = "a"; String pass = "a"; %> <a href="someServlet?[B][COLOR="Red"]name[/COLOR][/B]=<%=name%>&[B][COLOR="Green"]password[/COLOR][/B]=<%=pass%>"> Click Me! </a> [/CODE] Instead of <%=name%> you can have whatever …

Member Avatar for billybobc
0
139
Member Avatar for musthafa.aj

Use the method of JTable: setModel(TableModel dataModel). Create a DefaultTableModel object and pass that as parameter to the setModel method. Whenever you want to insert a new row, just call the method addRow of your DefaultTableModel instance. You don't need to call the setModel again as long you are calling …

Member Avatar for javaAddict
0
116
Member Avatar for Genni
Member Avatar for araaraa

Do you want us to convert that[B]!?!?[/B] You must be out of your mind. Do you even know java? You need to know java and have some understanding in php.

Member Avatar for javaAddict
0
100
Member Avatar for anevins

Assuming that you have read the number. - Use an "if" to see if it is greater than 2. Remember you need the sum of numbers from 2 till the number given. - Have a for loop for the sum: [CODE] for (int i=[B][COLOR="Green"]2[/COLOR][/B];i<=[I][B]givenNumber[/B][/I];i++) { } [/CODE] I hope that …

Member Avatar for javaAddict
0
213
Member Avatar for AllyC

Are the data saved correctly? If the problem was only with the reading then you didn't have to post all this code, because that will make people reluctant to reply. I would suggest this: Have a separate class with methods for reading and writing: [CODE] class IOManager() { public static …

Member Avatar for AllyC
0
162
Member Avatar for shubhang

[QUOTE=darkagn;717563]Hi Shubhang and welcome to DaniWeb :) I am sorry, but I don't understand what you are asking. Can you please post some code to show us what you mean?[/QUOTE] I think he is saying that when the application is running, in DOS for example, the window becomes too crowded …

Member Avatar for blackeyedanel
0
231
Member Avatar for aladar04

Use the equals method to compare Strings: [CODE] if ( ht.equals("h") ) { } [/CODE] Also you don't need to declare your integers [U]Integer[/U]. Simple int will suffice: [CODE] int x=8,y=1,heads=0,tails=0; [/CODE]

Member Avatar for aladar04
0
104
Member Avatar for Justin12345

When you get the number of tosses write if statements checking the validity of the information. You must have variables where you count the successes and the failures Then use a for-loop to print the: "Enter toss #"+i+ "output: " followed by the command for reading from the console. Once …

Member Avatar for aladar04
0
504
Member Avatar for scarface9477

1) Did you import their package? // import java.io.*; 2) Java is case sensitive: OutputStream, InputStream 3) Do the above and then post code if they don't work

Member Avatar for scarface9477
0
2K
Member Avatar for k2k

> Hi! Can sum1 plz help?!!! > here is the prob I'm having > `SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters`. First of all **Next Time** start a new Thread. My first guess would be that the table *PatientTable* has more columns than the ones you have at your …

Member Avatar for javaAddict
0
130
Member Avatar for chicago1985

There is a problem with your brackets. You do this: [CODE] if (conn!=null) { try { } } catch () { } [/CODE] Whenever you open something close it immediately and then write inside it

Member Avatar for javaAddict
0
84
Member Avatar for redZERO

This: [icode]File stuff = new File(stuff.txt);[/icode] Should be: [icode]File stuff = new File([B]"[/B]stuff.txt[B]"[/B]);[/icode] This: [icode]Scanner scan = Scanner(stuff);[/icode] Should be: [icode]Scanner scan = [B]new[/B] Scanner(stuff);[/icode] This: [icode]place = scan.NextDouble();[/icode] I think should be: [icode]place = scan.[B]n[/B]extDouble();[/icode] Look at this: [URL="http://java.sun.com/javase/6/docs/api/java/util/Scanner.html"]Scanner[/URL]

Member Avatar for javalearn
0
587
Member Avatar for P00dle

First of all here is a small misconception: This: [CODE] <VERSION>3.1</VERSION> <SMTPSRV>blue</SMTPSRV> [/CODE] is not Two nodes but Three! Node 1: <VERSION>3.1</VERSION> Node 3: <SMTPSRV>blue</SMTPSRV> Node 2: [CODE] <VERSION>3.1</VERSION> <SMTPSRV>blue</SMTPSRV> [/CODE] The new line character between </VERSION> and <SMTPSRV> So when you print this: [ICODE]System.out.println(node.getNodeName() + ":" + node.getNodeValue());[/ICODE] For …

Member Avatar for P00dle
0
116
Member Avatar for saikatroy1985

We can't help you because we don't know what you want. From the description of your problem, I believe that even you don't know what you want

Member Avatar for saikatroy1985
0
91
Member Avatar for ashaysumbha

You cannot execute java code from inside javascript. You need to submit the data and then update the textfields: [CODE] String mobile = request.getParameter("mobile"); String username=""; String password=""; String message=null; if (mobile !=null) { // the first time the page will render you will not have the mobile, so skip …

Member Avatar for javaAddict
0
93
Member Avatar for LucarioWill

You need to have an upper limit for the channels. Declare it as a constant in the TVRemote class. When you try to increase the channel above that limit then have channel become 1. When you try to decrease it below 1 have channel take the upper limit. The same …

Member Avatar for LucarioWill
0
214
Member Avatar for sujay007

[QUOTE=sujay007;1084258]My query is . I want java code to convert RGB image (jpg) into grayscale then i want to convert pixel of grayscale image i.e. if pixel is other than black conver it into white. if it is black then only it remain black.[/QUOTE] You don't other people's homework.

Member Avatar for peter_budo
0
91
Member Avatar for Afupi

[QUOTE=Afupi;1056637]The problem I am having is getting the out of bounds exception to work without calling either of the other two catches.[/QUOTE] I don't really get the above, but I have a few corrections to add. First, don't use the toString method of the exception. Use the getMessage to print …

Member Avatar for javaAddict
0
139

The End.