Recent update: 2008-5-9

XML -> Flat

378 byte By n2the8xa at 2007-11-15
i've posted on this before, but now that i have more information.we have this autogenerated java code from a mapping on mapforce (its a xml file). we want to stick this java code or files in a compiler (xcode) and compile it into a flat file.(if this doesnt make sense, im sorry, but bare with me. ...

using applet to execute a command on the server

340 byte By LeaTsabana at 2007-11-15
I want my applet to run a commend on a server. If I had a java program, I would have used Runtime.getRuntime().exec (cmd1, envArr, file)but I have an applet. so can I make it execute the command: "perl perlfile.pl" where perlfile.pl is on http://server/path/?the applet need some data that this ...

File

159 byte By Manthanaa at 2007-11-15
Hi all,When i open a File in Java for reading , is it locked ?If not is thr some way i can lock it programatically?Thanx in advance

JasperReport Problem on Server

289 byte By SLDykea at 2007-11-15
I have developed a Web app the generates JasperReports. The app woks fine on my local host server but will not work properly on the WebSphere Applications Server. When I try the servlet with the JasperReport calls I get get web page that says "The Web Site Cannot Display the Page".

Print variable whicj was read in another class

3643 byte By Nazakthula at 2007-11-15
i have a project in several classes the 1st class read from keyboard data and the last 2 classes (one report on main) print out the content which was read , the calculation and start the aplicationthe code is in next linesclass 1/** * */package main;import java.io.BufferedReader;import ...

Problem with HorizontalScrollBar in JScrollPane

708 byte By bester_uncle_festera at 2007-11-15
I instantiated a JScrollPane and immediately set its scrollbar policies upon instantiation. Why is it that my VerticalScrollBar works but my HorizontalScrollBar doesn't? The component inside my JScrollPane is a JEditorPane, and the cursor just simply goes to the next line without the ...

Why this does not work?

462 byte By adutta_hcla at 2007-11-15
Hi all,I got a very basic question. Why does not the constructor not_a_public() get called in the code below?class not_public{public static void main(String[] args) {System.out.println("Hello World!");not_a_public nap = new not_a_public();}}class not_a_public{ void not_a_public() ...

more exceptions

1991 byte By pfishera at 2007-11-15
i need to catch the exceptions if the input is not a number, not an integer, and out of range. I am not sure how to determine between the 1st 2 exceptions. i know i should use parseDouble and parseInt but how do both of these fit in?here is what i have so far, and help would be ...

hi

139 byte By Novela at 2007-11-15
what is the difference in wait(long time) and sleep(time) methods in thread life cycle.and wait() and wait(long time)?

Something wrong with this method :S

3609 byte By boblettoj99a at 2007-11-15
Hi, i am trying to make a fill tool for a paint program. All graphics are drawn on a JPanel and this method is eventually meant to fill an area of the same coloured pixels(you get the basic idea).here is the code(at the moment its only half done but thats not the important thing):public void ...

Help making this into a bean

5429 byte By eastendersa at 2007-11-15
I tried making a bean that connects to a db and runs a queary then returns the results in a list, the problem is i started out using a exsiting servlet which did something simarliar! Stupid to do i know!! as now i am having all sorts of problems below is the code can somebody please help me get ...

GUI help!!

5208 byte By da_master_of_nuthina at 2007-11-15
i am tryin to create a java gui, that will open a text file using a file chooser, then the gui should open a new window to display a list of certain things in the text file, any help?package filechooserframe;import java.awt.*;import java.awt.event.*;import java.io.*;import java.lang.*; import ...

sleep() Problem

1493 byte By GigiKenta at 2007-11-14
Hy i`m new to java ,studin it for 3 months;I got a code here ; works fine , no errors , but has a weird behaviorhere is the code :import java.awt.*;import javax.swing.*;public class MultiThread {public static void main (String []args) {Frame frame = new Frame("Frame");Frame frame2 = new ...

JScrollBar to be connected with JTextArea

214 byte By sakuraleea at 2007-11-14
How can I connect the two so that with the use of the scrollbar, i can scan the text in JTextArea? in my code, there was a scrollbar that appeared but when scrolled down, the text in JTextArea did not move..

Making a simple countdown timer

6274 byte By CJ426a at 2007-11-14
Hi,I'm taking an introductory course in Java, and am creating a GUI typing test program for a final project. The program is not fully complete as you can see; my next step is to make a timer to countdown from 60 seconds to 0. I can't seem to find how to do this anywhere and the code I have ...

Can someone explain for me, the concept of MESSAGE in java?

485 byte By New-Drop@Java-Seaa at 2007-11-14
Java tutorial at sun's site says: When object A wants object B to perform one of B's methods, object A sends a message to object B. Three parts of a message are: 1. The object to which the message is addressed (YourBicycle) 2. The name of the method to perform (changeGears) 3. Any parameters ...

Dispaly Tag

281 byte By Harikesha at 2007-11-14
Auto-paging of long lists.i want to display this arraylist in the Struts JSP using display tag. Tell me the technique of pagination too.Exam is that[First/Prev] 1, 2, 3, 4, 5, 6, 7, 8 [Next/Last]ID Name Email StatusAny help is appreciated.

Problem with MySQL function CONCAT

763 byte By proNicka at 2007-9-25
Hi all!I have simple SQL query, and it's work fine if I run it via MySQL console:SELECT contact.id, CONCAT (Contact_LastName, ' ', Contact_FirstName) AS ContactName, Contact_FirstName FROM contactBut, when I run it from Java application, it returns me an error ...

Collection of a class that implements a particular interface

398 byte By smakesyoujakea at 2007-9-25
I'm trying to make a collection class that uses Object's so it can store a few different types of Objects in it (can't use generics), but I'm getting tripped up on how to make sure that the Objects all implement the same interface in them. Every class that can be in my collection has a ...

someone needs your help..!!

243 byte By cutie_joeya at 2007-9-25
Number0247810frequently125345how to get this output? anybody can help me?your feedback are kindly appreciate... thank you...

Error messages! area(double, double) cannot be applied to ( )

3346 byte By JWest46088a at 2007-9-25
I keep getting these error messages:area(double,double) in Rectangle cannot be applied to ()return "Area: " + Rectangle.area() + "\tCircumference: " + Rectangle.perimeter();^perimeter(double,double) in Rectangle cannot be applied to ()return "Area: " + Rectangle.area() + "\tCircumference: " + ...

writing unchecked/runtime exception

57 byte By HarryJTyro@WTa at 2007-9-25
How can unchecked or runtimeexceptions be defined.

Names

85 byte By redzone646a at 2007-9-25
what are acceptable names for a String, like for a char: choice would be fine.

my motorcar class

591 byte By mark_8206a at 2007-9-25
i'm very new to java and having problems with the below code, there seems to be no errors in it but i can't get any output.i should see "the engine is already running" but i get a nosuchmethod error message, anyone know what i'm doing wrong?...thanksclass MotorCar{boolean engineRunning;void ...

Best place to load Images in applet game

990 byte By TKennya at 2007-9-25
Sorry for the double post but I just realised I originally posted this in completely the wrong forum!Hello,I have made a fairly basic game of 21/BlackJack and was wondering where the best place to load the card Images is/was...Currently I am loading the images into an Image[ ] in the applet ...

API

151 byte By Jakkoa at 2007-9-25
This may sound like a daft question, but where can I download the Java 1.4.2 API? I dont always have the Internet, so i need an offline version.

Help with Java program for my Java Script class

6691 byte By lkahlrona at 2007-9-25
Hello all I am taking a java course at school and it ends tomarrow 9-3-06. I have a program started but i can't get the logo or the buttons to show up and work. Could someone tell me what i did wrong and how to fix it please?import java.util.Arrays;import javax.swing.*; import ...

Non-static trying to access static

647 byte By subnetrxa at 2007-9-25
I'm trying to get the hang of Java by writing a gui xml parser. I'm coming from PHP so programming isn't new, but I didn't do a lot of OO in PHP. Anyway, I have a public method(go) from a public class that returns a variable of type Document.Error says that the non-static method go cannot ...

NON Blocking Char Input

618 byte By olafa at 2007-9-25
if from console set#stty cbreakthe next program do not wait for <CR> after each keystroke.// HOW to set system("stty cbreak"); inside the program?===================================import java.io.*;class CharRead { public static void main(String args[])throws IOException {char c;// ...

How to append in JTextPane?

279 byte By divyabhaskarana at 2007-9-25
hai forum,Please solve my little problem.I have to display certain simple string in a jTextPane everytime i click on a button.Is there a way to append the sring without overwriting the previous one?Also how should i clear off JTextPanel?Regards

Problem with Car Registration Validation Code, Please Help !!

1620 byte By brainiac125a at 2007-9-24
Hi Folks, I'm trying to validate a vehicle registration which can either be in the format A100AAA or AA01AAA ( old and new style registrations ). I know there must be a better way of doing it than in my code as attached but I'm in dire need of enlightenment. Any help would be much ...

Truncate String

336 byte By pvnprasada at 2007-9-24
Hi All,I am new to Forum . I want to truncate the following string with 5 character and rest take next line until target string completed.String target="This is test text";int maxSize = 5;Output is below:This is test textThanks for ...

why doesn't borderlayout work?

2601 byte By bigbencooka at 2007-9-24
Borderlayout seems to not work here. I need the textfield to be north, two buttons under that, and then a label south, but it only shows the label, but if I comment out the field, I see the buttons, please help, here is my codeimport java.awt.*;import java.awt.event.*;import java.io.*;import ...

switch

664 byte By jaaya at 2007-9-24
int x=5;switch(x){case 5:System.out.println("case 1"+x);break;case 2:System.out.println("case 2"+x);break;}now if i remove the break statement after case5 then the next statement also gets executed.However if i write code like thisint x=2;switch(x){case 5:System.out.println("case ...

set the System resolution

356 byte By surajkumara at 2007-9-24
hi all,I want to set the screen resolution in java 1.3.I got the screen resoluion by using Toolkit.getDefaultToolkit().getScreenSize(). Now i want to set the new resolution. Please tell me how to set it.it should be compatible to java 1.3.Please i need help. thanks.Regards,Suraj ...

CPU, RAM and Disk Utilisation

203 byte By PatrickClarkea at 2007-9-24
Hi,I am new to Java programming and am trying to identify if there are any classes available to me to determins O\S RAM, CPU and Disk utilisation. Please advise?Thanks,Patrick

obtuse

900 byte By codemonk99a at 2007-9-24
HelloI am ashamed to ask, but can someone tell me why the last assignment fails and without it the program compiles and runs fine? It is claiming Object found, needing int. I dont know(obviously), how I could understand how to use an ArrayList and not be able to use it in a assignment.import ...

Date

71 byte By DesarrolloScreenNamea at 2007-9-24
If I have a date objet, how can I get the next day?Thanks

ActionListener demonstrate Observer Pattern?

96 byte By sola at 2007-9-24
Would using ActionListener in a program be considered an example of the observer pattern?

jre1.5 applet "broken" on my linux system

904 byte By techristiana at 2007-9-24
I re-compiled my old webpage marquee applet on Windows XP with the new 1.5 compiler. It works fine when I'm on the XP machine. When I go to my Mepis Linux machine the applet shows "X" for broken/missing applet. I have tried to install 2 packages on this Linux machine, including ...

How do I read a file header?

338 byte By pompiusesa at 2007-9-24
I want to validate that a given file actually is of a specific type. For instance that a .pdf file actually is a pdf file.To achive this I want to read the header of the file and validate the header information.Exactly how do I read header info from a file?Links to examples or tutorials would ...

Help reference to some information

232 byte By Sms56a at 2007-9-24
Hi everybody, am working on a sports tournament management system for final year project and was wondering if anybody could direct me to some links which might have some relevant information to help in the development process

Not specific to particular subject

396 byte By mssa at 2007-9-24
In my application I have used various external jars like jre1.2....., jdom, itext,etc.Now after compiling my program if i want to run the application on another machine which doesn't have these jars will my program run. I mean is everything automatically included in the .class files.What is ...

Structuring your package

891 byte By java80a at 2007-9-23
Hi Friends,When I make applications under tomcat i usually follow this structure i.e Under webapps:project folder--WEB-INF folder--classes folder--com folder-test folder*.class files*.java files--web.xml file*.jsp filesBut I am given an application to study,with the following structure:project ...

uploading images to a PHP script

524 byte By ivanko_98a at 2007-9-23
hello. I just started learning Java... so... sorry for elementary questions.I would appreciate it if someone could give me a clue as to what to read in the Java documentation regarding to uploading images to a PHP script on the server. I dont mind researching by myself but it would be great if ...

Returning a color

544 byte By knektera at 2007-9-23
Im trying to figure out how to return a color depending on where it is displayed on the applet. I want to make a method where I can input the X and Y coordinates and have it return what color the object is at that point. Obviously its going to be somthing like:public Color findColor(int x, int ...

log in page+ how to change existing Password in DB

1706 byte By chibia at 2007-9-23
hi alli have here my partial program on how to verify if the user and password exist in the database. what i want to do next iscreate another method or sumwhat class on how to change the existing password after succesful log in public void validate() {boolean validlogin = false;String user = ...

Error compiling

2858 byte By erintheresea at 2007-9-23
I can't get my Java code to compile. It's for my university class, it's an assignment due tomorrow, to make a command-line calculator. I've tried to find the tutor for help but he seems to have disappeared. If anyone is able to help me fix these errors, I'd be on easy street for finishing ...

Positioning Swing Components

407 byte By J.Shawa at 2007-9-23
Due to the complexity of my GUI, I need to explicitly place my components (JLabel, JTextArea, JCheckBos, etc.) on the JFrame. setLocation(x,y) would be ideal and my underatanding is that this method is inherited by the components. However, using this method seems to have no effect on component ...

I am trying to compile an applet

146 byte By Bendesigna at 2007-9-23
Hi, I am trying to run an applet with JDK, but I keep getting this messagecan anyone tell me how to correct this error.thanks