129 Posted Topics

Member Avatar for itisnot_me

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 …

Member Avatar for itisnot_me
0
95
Member Avatar for P00dle

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));

Member Avatar for parry_kulk
0
194
Member Avatar for polisetty
Member Avatar for jaytheguru

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.

Member Avatar for parry_kulk
0
384
Member Avatar for musthafa.aj

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 …

Member Avatar for musthafa.aj
0
126
Member Avatar for shridharmaster

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

Member Avatar for GreenDay2001
0
116
Member Avatar for ytregnn

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]

Member Avatar for parry_kulk
0
57
Member Avatar for JohnBlanco

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, …

Member Avatar for JohnBlanco
0
121
Member Avatar for rahul8284

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 …

Member Avatar for parry_kulk
0
79
Member Avatar for JohnBlanco

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

Member Avatar for JohnBlanco
0
178
Member Avatar for manreddy

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]

Member Avatar for parry_kulk
0
57
Member Avatar for feoperro

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]

Member Avatar for feoperro
0
204
Member Avatar for feoperro

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]

Member Avatar for feoperro
0
303
Member Avatar for shashikant.v

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); …

Member Avatar for AndreiDMS
0
77
Member Avatar for musthafa.aj
Member Avatar for parry_kulk
0
79
Member Avatar for hardik.rajani
Member Avatar for parry_kulk
0
137
Member Avatar for nikolzn

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("* …

Member Avatar for parry_kulk
0
97
Member Avatar for deadllama19

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 <= …

Member Avatar for GTJava
0
102
Member Avatar for _dragonwolf_

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 …

Member Avatar for parry_kulk
0
708
Member Avatar for Hanyouslayer

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 …

Member Avatar for Hanyouslayer
-1
1K
Member Avatar for kenji

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){ …

Member Avatar for kenji
0
96
Member Avatar for ubundows

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[] …

Member Avatar for parry_kulk
0
132
Member Avatar for oldSoftDev

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

Member Avatar for oldSoftDev
0
129
Member Avatar for babylonlion

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 = …

Member Avatar for babylonlion
0
122
Member Avatar for mdminternet

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

Member Avatar for mdminternet
0
205
Member Avatar for isuruj
Re: Ant

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

Member Avatar for isuruj
-1
115
Member Avatar for Xessa

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]

Member Avatar for parry_kulk
0
107
Member Avatar for udayangaS

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]

Member Avatar for udayangaS
0
62
Member Avatar for jrosh

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 …

Member Avatar for parry_kulk
0
903

The End.