1,963 Posted Topics

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
107
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
118
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
6K
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
220
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
75
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
75
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
93
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
126
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
567
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
189
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
266
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
193
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
202
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
41
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
102
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
422
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
131
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
126
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
137
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
113
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
96
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
210
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
158
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
228
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
102
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
501

The End.