129 Posted Topics
Re: In the line [CODE] document.getElementById("txtHint").innerHTML=xmlhttp.responseText; [/CODE] you are changing the inner html of the table row with id=txtHint When you are adding a new row by clicking on 'more produce' button you are adding a new row again with id=txtHint. Hence response changes the value of first row always. You … | |
Re: The parse(String) requires a URI, so on windows system add "file:///" before the filename So use Document doc = factory.newDocumentBuilder().parse("file:///"+fileName); Or better use Document doc = factory.newDocumentBuilder().parse(new File(fileName)); | |
Re: you can also try, javac zz.java 2> compile.txt | |
Re: From the stacktrace the exception is java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver meaning that the jar file containing the jdbc drivers is not available. Try placing the jdbc driver jar file e.g. classes12.jar for Oracle 10g in the folder <tomcat_home>\common\lib and restarting tomcat It does not seems to be a d/b server location issue. | |
Re: A suggestion that instead of trying to open IE in a frame why not use the embedded IE rendering engine with the jelp of JDIC project at java.net [url]https://jdic.dev.java.net[/url] It has a WebBrowser component that can be directly added to a frame/panel. You also have the option to choose between … | |
Re: You can use the script at [url]http://code.google.com/p/getelementsbyclassname/[/url] to get the list of elements of a given class name and than iterate through the list and change the className property of each element in javascript ![]() | |
Re: The form can be displayed or kept hidden by using the 'display' and 'visibility' css properties which are manipulated in javascript function. Either you can change these properties or call the function 'form_visible()' on loading of the page. You can try something like this [CODE] <body onload=\"form_visible();\"> [/CODE] | |
Re: Hope this example helps you [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- var nums = new Array("1","2","3","4"); var alphabets = new Array("A","B","C","D"); function addOptions(dropDown, dispName, value){ var optn = document.createElement("OPTION"); optn.text = dispName; optn.value = value; dropDown.options.add(optn); } function setOption(form, … | |
Re: In web server like Tomcat there is a web.xml located at <tomcat_home>\conf\web.xml The <session-timeout> tag there is applied to all the web applications by default This value can be overridden in web.xml of each web application which is located at <tomcat_home>\webapps\<your_app>\WEB-INF\web.xml You can also override programmatically using HttpSession.setMaxInactiveInterval(int interval); for … | |
Re: From the condition statement in the javascript function it seems that the form name is 'classic' but while setting focus you are using 'newuser' as form name at this line document.newuser.userPassword.focus(); This will break the javascript execution. Changing the above line to document.classic.userPassword.focus(); might solve your problem | |
Re: The jsCalendar is a nice inline as well as popup calendar. You can find it at [url]http://www.dynarch.com/projects/calendar/old/[/url] | |
![]() | Re: There are many libraries available which read/write CSV files. You can try these one, [url]http://opencsv.sourceforge.net[/url] [url]http://sourceforge.net/projects/javacsv[/url] ![]() |
![]() | Re: You will have to apply following CSS to the <BODY> tag background-image: url(myimage.jpg); background-attachment: fixed; for example, [CODE] <STYLE> BODY { background-image: url(myimage.jpg); background-attachment: fixed; background-repeat: no-repeat; } </STYLE> [/CODE] ![]() |
Re: You can extend JFrame to have a JTextPane with scrollbars. Then use JTextPane's setPage() method to point to the html file. Below code snippet will provide you the clues, [CODE] JTextPane tp = new JTextPane(); JScrollPane js = new JScrollPane(); js.getViewport().add(tp); JFrame jf = new JFrame(); jf.getContentPane().add(js); jf.pack(); jf.setSize(400,500); jf.setVisible(true); … | |
Re: You can use JNIRegistry [url]http://www.trustice.com/java/jnireg/index.shtml[/url] | |
Re: You can use libraries like SMSLib [url]http://www.smslib.org/[/url] | |
Re: hope the following code helps, [CODE] import java.util.Scanner; import java.util.Random; import java.io.IOException; import java.io.PrintWriter; import java.io.File; public class PasswordTest { public static void main(String [] args) { Scanner in; in = new Scanner(System.in); Random rand = new Random(); System.out.println(" Password Generation Menu "); System.out.println("********************************************************"); System.out.println("* [1] Lowercase Letters *"); System.out.println("* … | |
Re: Hope this can help you. I found it while surfing [CODE] /** Precondition: width is an odd number >1*/ public void diamond (int width) { int middlePoint = width/2; int currentRow=0; for(int i=0; i<width ;i++){ String spaces = ""; for(int j=0;j<Math.abs(middlePoint-currentRow);j++){ spaces+=" "; } String stars="*"; int noOfStars; if(currentRow <= … | |
Re: You will have to check for each character in the input binary string to see if it is 0 or 1. Hope following example helps you, [CODE] import java.util.*; public class BinToDecRec { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter 999 to exit program"); System.out.println("Enter … | |
Re: See the algorithm for prefix to postfix conversion at [url]http://fahadshaon.files.wordpress.com/2008/01/prefix-to-postfix-stack-algo.pdf[/url] It can be easily implemented as follows, [CODE] import java.io.*; import java.util.*; public class lab8 { public static String LEFT_DONE="LEFT_DONE"; public static void main(String[] args) { String strPrefix=""; String strPostfix=""; //declare the operators stack Stack<String> operatorStack = new Stack<String>(); try … | |
Re: You will require to use PrintStream for that e.g. [CODE] import java.io.FileOutputStream; import java.io.PrintStream; public class FormattedFileIO{ public static void main(String[] args) { int a=1; int b=2; double c=3.45; System.out.printf("%2d%6d%23f...",a,b,c); FileOutputStream out; PrintStream ps; try { out = new FileOutputStream("myfile.txt"); ps = new PrintStream(out); ps.format("%2d%6d%23f...",a,b,c); ps.close(); } catch (Exception e){ … | |
Re: this code might be useful to you, [CODE] import java.util.Scanner; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.ArrayList; import java.util.Collections; public class CharacterDistribution { public static void main(String[] args) { HashMap<Character, Integer> charDist = new HashMap<Character, Integer>(); Scanner input = new Scanner (System.in); input.useDelimiter("\n"); System.out.print("Enter Text :"); String strText=input.next(); char[] … | |
Re: Seems that p.getEmployees() is returning a List. You will have to iterate that list and than use the getName() method for each 'Employee' object in the list | |
Re: Try this code [CODE] import java.awt.*; import java.awt.geom.*; import javax.swing.*; import javax.swing.event.*; public class SquareSliderTest{ public static void main(String[] args){ EventQueue.invokeLater(new Runnable(){ public void run(){ SliderFrame frame = new SliderFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); } } class SliderFrame extends JFrame { public SliderFrame() { setTitle("Square Slider"); setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); component = … | |
Re: Html comments are <!-- --> and not <!-- --!>. Try replacing [CODE]<!--begin header--!>[/CODE] with [CODE]<!--begin header-->[/CODE] and so on in the rest of the html code | |
Re: Use the 'copy' task [CODE] <project name="blank" default="copy_file"> <property name="srcfile" value="\\remote_mc_name\srcdir\file.txt"/> <property name="destpath" value="C:\destdir"/> <target name="copy_file" > <copy file="${srcfile}" todir="${destpath}"/> </target> </project> [/CODE] you can use the IP address instead of the remote_mc_name for source file path | |
Re: Hi, You can use the opencsv library. It will help in read/write csv files. It also has constructors that let you supply your own seperator. i.e. you can specify semicolon as the seperator [url]http://opencsv.sourceforge.net[/url] | |
Re: Hi, Hope the following links help you [url]http://java-aap.blogspot.com/2006/04/hibernate-annotations-composite.html[/url] [url]http://boris.kirzner.info/blog/archives/2008/07/19/hibernate-annotations-the-many-to-many-association-with-composite-key/[/url] | |
Re: You can extend the JTextField and JPasswordField components as shown in the example below [CODE] import java.awt.Color; import java.awt.Font; import java.awt.*; import java.awt.font.*; import java.awt.image.BufferedImage; import java.io.*; import javax.swing.*; class BGTextField extends JTextField { BufferedImage img; TexturePaint texture; String bgText; public BGTextField(String bgText) { super(); this.bgText = bgText; } public … |
The End.