1,963 Posted Topics
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: [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 … | |
Re: 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 | |
Re: 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: Don't hijack other's people threads [I]mzashi hassan[/I], and do your OWN homework. We will not do it for you. | |
Re: 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 … | |
Re: [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! … | |
Re: 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 … | |
![]() | Re: 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 ![]() |
Re: Actually I was thinking something like this: [CODE] public double getSqrRoot( argument ) throws ArithmeticException { // code } [/CODE] | |
Re: [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(); … | |
![]() | Re: 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 … |
Re: 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; } … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: Did you write this code? Your answer will determine our answer. | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: [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 … | |
Re: 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] | |
Re: 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 … |
The End.