Recent update: 2008-5-9
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. ...
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 ...
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
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".
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 ...
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 ...
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() ...
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 ...
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)?
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 ...
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 ...
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 ...
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 ...
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..
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 ...
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 ...
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.
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 ...
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 ...
Number0247810frequently125345how to get this output? anybody can help me?your feedback are kindly appreciate... thank you...
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: " + ...
How can unchecked or runtimeexceptions be defined.
what are acceptable names for a String, like for a char: choice would be fine.
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 ...
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 ...
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.
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 ...
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 ...
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;// ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
If I have a date objet, how can I get the next day?Thanks
96 byte By
sola at 2007-9-24
Would using ActionListener in a program be considered an example of the observer pattern?
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 = ...
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 ...
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 ...
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