Originally posted by Luke Smtih: sorry i was a bit vague.. ok all i want to know is if it is possible to have a button in one java program that when clicked will run another java program that i have made.
It's vague again. Do u mean to run your class in a new JVM, when a button was clicked? Or you just need to run a new class, popping up with a new window?
If you can specify the thing that you want in details, it would be better for us to be able to explain you clearly...
Co-author of SCMAD Exam Guide, Author of JMADPlus SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
posted 16 years ago
haha ok third time lucky haha
ok i have a program which just has a text input box at the top which allows the user to enter an SQL statement to search through other tables in the database or add tables etc etc. I want to put a button on it which, when clicked, will run another java file that i have which is for caculating the difference between two dates.
im not to suer what u mean by JVM is that java virtual machine? all i want it a to click a button which will run the other program in a different window.
perhaps you are familiar with the method "public static void main(Stringargs)" You've typed it a million times, but all that stuff has meaining! Main is a static method which takes an array of Strings as the arguments. One way to "run" a class from another one is to just call that main!
try that out...
I've heard it takes forever to grow a woman from the ground
posted 16 years ago
ok thanks for the advice... i am getting two errors when i compile now, im not suer if i have put the "DateDiffGUIApplet.main(new String);" in the right spot or i need further code for it to run that file...
ERRORS --------------------Configuration: <Default>-------------------- DisplayQueryResults.java:15: <identifier> expected DateDiffGUIApplet.main(new String); ^ DisplayQueryResults.java:15: cannot resolve symbol symbol : class main location: class DateDiffGUIApplet DateDiffGUIApplet.main(new String); ^ 2 errors