18/05/2012 12:08
What I want to have happen is in this [b]exact[/b] sequence, after theuser clicks a button: 1) Button becomes unpressed2) setYouSelected()3) makeMySelection()4) Thread.sleep(1000)5) Display results Instead this happens: 1) setYouSelected()2) makeMySelection()3) Thread.sleep(1000)4) Button becomes unpressed5) Display results Here is the code to implement what should be the first order: [code] /** * Handle the value of {@link javax.swing.JButton} pressed * @param evt {@link java.awt.eve.... read more

5 answers click here to view

17/05/2012 12:08
I have a java program running on a windows base os (JDK 1.3.1) : NT is thiscase the essence of the code is here under.
it turns out that this piled up a lot of winmsd processesas this code is executed several times day.
the winmsd processes would stay even after the program exitedWhat am i doing wrong?======================================Runtime rt=Runtime.getRuntime(); Process proc; try { proc=rt.exec(winmsd /a/f); proc.waitFor(); proc.destroy(); } catch (Exception e) { System.... read more

1 answers click here to view

16/05/2012 12:08
Greetings, here is my code: import java.util.*; class BinarySearchTreeSet{ // Inner class defining a binary tree node private class TreeNode { private TreeNode left; private Comparable key; private TreeNode right; } // instance variables private TreeNode root, parent, child; // Constructor public BinarySearchTreeSet() { root = null; } // Inserts a key into the set public void insert(Comparable key) throws DuplicateKey { TreeNode newNode; if (s.... read more

5 answers click here to view

15/05/2012 12:08
hi i have done this coding in order to do image loading and then getits height and width but it is showin an error that unable to loadimagecould you plz check it and let me know where i m going wrong..
import java.awt.Image;import java.awt.Toolkit;import java.awt.image.ImageObserver;import java.net.URL;import javax.swing.JPanel;import java.awt.*;import java.awt.Component;public class Viewer extends JPanel{ private static Image image; public Viewer(URL url) { MediaTracker tracker; .... read more

1 answers click here to view

14/05/2012 12:08
need to find javadocs for 1.2.. they have an API index here http://java.sun.com/reference/api/index.html but no 1.2 J2SE, only J2EE if anyone knows where I can find 1.2 J2SE docs I would appreciate the lead..
thank you,Frances

1 answers click here to view

13/05/2012 12:08
Assume I have a number of milliseconds.
How can I convert this value into a more human-readable format with days, hours, minutes and seconds like: 56d17h23m56s If the number of days is equals to 0 then the d part should be omitted.
Ulf

2 answers click here to view

12/05/2012 12:08
Hello all, Using a servlet, I'm trying to construct a form that displays a list of items in a database, and gives the user three options to perform: View, Edit, or Delete. I would like it to appear such that there is a checkbox next to each item, and the user could then check that box and select one of the three buttons at the top (or bottom) of the page. I used a while loop to iterate through the database to retrieve all the items (cars) relevant to the user, and for each item, p.... read more

7 answers click here to view

11/05/2012 12:08
Hi All, I have a strange problem... I have > 1000 threads wanting to send datathrough synchronized DataOutputStream wrapped around a socketsOutputStream. Replies sent across the internet are received perfectlyin the sent order but across the router the stream is somehowcorrupted.
Is there something I need to set to stop this problem? Please take a look a the code and corrupted output to see if I'm justbeing a bit dumb... thanks to send: try { synchronized(dos) { System.out.prin.... read more

7 answers click here to view

10/05/2012 12:08
I have 3rd party vendor program that writes the date and time out inmilliseconds (ex: 1031030063000000). Using Java, how can I convertthis number to the actual date & time? Thanks,Tequila

1 answers click here to view

09/05/2012 12:08
hi everyone...
i using IBM Websphere studio application developer v 5.1.2. tocreatesome java projects. but i m not able to debug them. can someoneexplain me how to debug a .class file made in the above tool? i haveadded breakpoints but the execution does not pauses at those points,instead the program completes without pausing. Also i m not able towatch my variabe. Please help me.

1 answers click here to view

08/05/2012 12:08
For Pentecost, I've written a Java applet that displays the Jesus Prayer, Lord Jesus Christ, son of God,have mercy on me, a sinner.
in various languages: http://www.albany.net/~hello/jp2.htm So far I have: English, French, German, Latin, Italian, Spanish, Cherokee,Dutch, Finnish, Swedish, Serbian, Vietnamese, Slovak, Old ChurchSlavonic, Russian, Hebrew, Hawaiian, Greek, Polish, Czech, Maori,Swahili, Albanian, Portuguese, Plautdietsch, Romanian, Haitian,Japanese, Tagalog, Danish, Icelandic.... read more

1 answers click here to view

07/05/2012 12:08
Hi, excuse this silly question ...
Are we permitted to extend java.io.File.
javac (using Netbeans) gives me the following error: Hi - I think I'm making a basic mistake.
cannot find symbol: symbol : constructor File()location: class java.io.Fileclass Dir extends java.io.File {1 errorBUILD FAILED (total time: 5 seconds) Cheers

2 answers click here to view

06/05/2012 12:08
I have some shopping cart code that I took over when I started with a compa=ny, but unfortunately I'm weak on Java and integrating with Paypal. Here is= the form that sends data to Paypal when a customer checks out of the shopp=ing cart. I can get it to send one product, but I would like it to include =data on all the products purchased from the cart. I am thinking logic:itera=te will help me? But then how do I increment the on# and os# when prese=nted with a variable amount of products? <.... read more

2 answers click here to view

05/05/2012 12:08
I'm new to Java (distance learning) and struggling with a question inmy first assignment. I have to draw 3 concentric circles, promptingthe user to input a radius. I've managed that, managed to get the 3circles centered, however, when I minimise and maximise the Applet,the circles get smaller and smaller. I'm at a lost, been trying tofigure it out for about a month now. I have one class prompting theuser for the radius and then passing the values to another class toactually draw .... read more

6 answers click here to view

04/05/2012 12:08
Hi, All, I start up from a MIDlet and transfer to a GUI Canvas when press a soft key, but the GUI.javanever answer my addCommand request ....
I mean, these soft buttons I add, they didn't show up on the screen, and I my call code is : ====================display.setCurrent(gui)======================= what's wrong...@@? Best regards,Boki.

8 answers click here to view

03/05/2012 12:08
I am new to java and I am trying to determine the best way to parse aninput file to extract data.
// example input file: ...
token1=someDatatoken2=someMoreDatatoken3=evenMoreData...
I want to have a function, getField(String token), that will parse thefile and extract data depending on the given token. example: System.out.println( getField(token1=) );System.out.println( getField(token3=) ); The previous print statements should display: someDataevenMoreData There has to be a nice clean easy way.... read more

1 answers click here to view

02/05/2012 12:08
Hi, Sorry, not Java language specific, but I can not find anywhere elseto post this[?]..
Does anyone know if it's possible to write Javadocs outside of .javasource files, so instead of..
/////// test/Test.java ///////package test;/** Javadoc about my Test class */public class Test{ /** Javadoc about my Run method */ public int Run(int a) { .. }} ..something like the following could be done..
/////// test/Test.java ///////package test;public class Test{ public int Run(int a) { .. }} /.... read more

13 answers click here to view

01/05/2012 12:08
This should be easy, but I can't find an example anywhere on the web.
In my Java program (not Javascript) I want to detect when a new fileis written to a directory, then read it in, and operate on it. Howcan I check a directory for new files when running? Any suggestions? J.

3 answers click here to view

30/04/2012 12:08
Hi I am trying to make a small issue tracker to for learning JSP/Servelets. I am trying to follow MVC architecture for the same and Iam stuck in a design issue with model classes.
Here is the scene....
There is a entity IssueAtribute, which represents elements in aIssue. (Basically entity Issue contains a Ordered List ofIssueAttributes).
Now IssueAttribute can be of various types eg. TextIssueAttribute,LongTextIssueAttribute, DateIssueAttribute, etc. The View in the MVCwill probably use this .... read more

1 answers click here to view

29/04/2012 12:08
I hava a panel, with two jspinners, let's call them spin1 and spin2.
To each spinner I attach listeners for page up, let's call themlisten_spin1 and listen_spin2. No matter if I place the focus inspin1 or spin2 only spin1 gets modified. This is rather annoying andnot desired.
I have checked to make sure the constructor of each listener getscalled, and they do.
So, I am wondering, where am I missing the boat? Regards, Steven

1 answers click here to view

28/04/2012 12:08
I am very new to Java and programming in general, and was hopingsomeone could point me in the right direction with this. I am writinga program consisting of a String array (the elements are lines oftext) and Id like to randomly pull an element from the array anddisplay it. I havent been able to figure out how to utilize thejava.util.random for this particular case. Thanks in advance for anyhelp

5 answers click here to view

27/04/2012 12:08
How do I go about developing a program for j2me? I have made a sample sudoku solver and wish to try it on my pda but cannot make a jad file. I probably need to compile it for j2me too, i suspect.
ThanksAllan

9 answers click here to view

26/04/2012 12:08
im writing a javascript that will allow me to do the ackermannfuction. it is titled a.java it looks like this: __________________________________ public static int ackermann(int m, int n) { if (m == 0) return n+1; else if (m > 0 && n == 0) return ackermann(m-1, 1); else return ackermann(m-1, ackermann(m, n-1)); }___________________________________ i get the error that says a.java:1: class, interface, or enum expected public static int ackermann(int m, int n) ^.... read more

4 answers click here to view

25/04/2012 12:08
Could anyone provide some suggestion or opinion about Java Hibernate ?Which approach is the best or the the first step for beginner ? I juststarted with Java Hibernate and don't know the direction. Should Ilearn Hibernate with Servlet/JSP orHibernate/JDBC or Hibernate/MySql etc. I use eclipse to program JavaEE and I like to be good in Java Hibernate,please shed some light.
Thanks in advance.

1 answers click here to view

24/04/2012 12:08
Have posted this question on Database forum too but haven't received anyreply.
Could someone let me know the website where all the classes for SQLJ aredocumented (classes like ConnectionContext, DefaultContext, Iteratoretc.) TIARaquel.

1 answers click here to view

23/04/2012 12:08
Hello, the situation is as followes: I have a bunch of Foo threads which all have a pointer to the same instance of SomeClass. SomeClass has a synchronized method someFunction() so that only one Foo can acces it at a time. so far so good.
Now: in someFunction() if someCondition the current thread must block until further notification by another thread Foo. (A piece of code below to make it more clear.) What would be a good way to do that? I have tried wait() and notify() in a lot of ways but I a.... read more

3 answers click here to view

22/04/2012 12:08
Hi, I am a total newbie here. I've been searching the web for a few hourslooking for a good answer to my question, but have found nothing. Sorry tobug you guys with what I'm sure is a dumb question, but I just can't figureit out. Here goes...
I just recently downloaded J2SE 5.0. I have run the program and, as far asI can tell, have installed it. I then started looking for a good tutorial,and found this on the Java website (I'm sure you'll recognize it): http://java.sun.... read more

3 answers click here to view

21/04/2012 12:08
I want to extract words that may or may not contain , and .ex. 94 *& I, am words. 38 **#()#* I, am words.This is what I have: ([s]+[a-zA-Z,.]+[s]+)

2 answers click here to view

20/04/2012 12:08
Hi, I'm using JBoss and I am trying to compile a HelloServlet.java. However, I get several errors, and I think the CLASSPATH variable isn't set properly. Currently it is: c:j2sdk1.4.2_10lib ools.jar;C:Program Filesjboss-4.0.4.CR2serverdefaultlibjboss.jar;C:ProgramFilesjboss-4.0.4.CR2in un.jar;c:j2memidp2.0fcsclasses;.
Is this the right CLASSPATH? The HelloServlet.java which I'm trying to compile is: --------------------------------------------import java.io.*;import javax.servlet.... read more

1 answers click here to view

19/04/2012 12:08
Hi, I have an executable that calls jvm for which i dont have a source code, but i have the source code for java classes that are called.
I want to attach a debugger to that process so i can fix some code in java classes.
Can you suggest a java debugger that can attach to a running exe process? Thx, J

1 answers click here to view

eDiscover
Helpforce eDiscover provides technical articles updated each day
Click the logo to go back to the main page
Java

Helpforce eDiscover RSS feed contains the latest technical articles in RSS Java is a programming language developed by Sun Microsystems (which has since merged into Oracle) and released in 1995 as a core component of the Java platform. With many innovative features, Java is currently one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users.

Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS