3D environment in pure java programming

hi all,
my problem is dat...
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
</applet code="project1" width=1024 height=768>
</applet>
public class project1 extends Frame implements ActionListener , MouseListener {
     deathscreen screen=new deathscreen();
     int choice;
     project1(){
          super("3D-Image Processor");
          setSize(1026,768);
          setVisible(true);
          setResizable(true);
          addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent we){System.exit(0);}});
          addMouseListener(this);
//MENU BAR----------------------------------------------------------------------------------------------------------
          MenuBar mbar=new MenuBar();
          setMenuBar(mbar);
          Menu file=new Menu("File");
          MenuItem item1,item2,item3,item4;
          file.add(item1=new MenuItem("New...."));
          file.add(item2=new MenuItem("Open..."));
          file.add(item3=new MenuItem("-"));
          file.add(item4=new MenuItem("Close.."));
          mbar.add(file);
          Menu edit=new Menu("Edit");
          MenuItem item5,item6,item7;
          edit.add(item5=new MenuItem("Cut...."));
          edit.add(item6=new MenuItem("Copy..."));
          edit.add(item7=new MenuItem("Paste.."));
          mbar.add(edit);
          Menu components=new Menu("Components");
          MenuItem item9,item10;
          components.add(item9=new MenuItem("Canvas............"));
          components.add(item10=new MenuItem("General Properties"));
          mbar.add(components);
          Menu help=new Menu("Help");
          MenuItem item11=new MenuItem("Help...");
          help.add(item11);
          mbar.add(help);
          //MyMenuHandler handler=new MyMenuHandler(this);
          item1.addActionListener(this);
          item2.addActionListener(this);
          item3.addActionListener(this);
          item4.addActionListener(this);
          item5.addActionListener(this);
          item6.addActionListener(this);
          item7.addActionListener(this);
//Item8 destroyed(Component class removed)
          item9.addActionListener(this);
          item10.addActionListener(this);
          item11.addActionListener(this);
//CALL OF INDIVIDUAL COMPONENTS------------------------------------------------------------------------------          
          screen.setVisible(true);
          screen.setResizable(true);
     public static void main(String args[]){
          new project1();
     public void paint(Graphics g){
          setBackground(Color.gray);
     public void actionPerformed(ActionEvent e){
          if(e.getActionCommand()=="Close.."){
               System.exit(0);
          if(e.getActionCommand()=="Canvas............"){
               screen.setVisible(true);
          if(e.getActionCommand()=="General Properties"){
               screen.gen.setVisible(true);
//MOUSE COMPONENTS---------------------------------------------------------------------------------------------
     public void mouseClicked(MouseEvent me){
          screen.setVisible(true);
          screen.gen.setVisible(true);
     public void mouseEntered(MouseEvent me){}
     public void mouseExited(MouseEvent me){}
     public void mousePressed(MouseEvent me){}
     public void mouseReleased(MouseEvent me){}
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.io.*;
class genproperties extends Frame implements AdjustmentListener,ActionListener{
     Scrollbar red;
     Scrollbar blue;
     Scrollbar green;
     Canvas colour;
     Label r;
     Label g;
     Label b;
     Scrollbar thickness;
     Scrollbar height;
     Label th;
     Label he;
     Button SelectRect;
     Button SelectPoly;
     Button DrawRect;
     Button DrawPoly;
     Button DrawCircle;
     Button DrawLine;
     Button Pencil;
     Button Plotter;
     FileOutputStream temp;     
     int choice=0,i=0;
int props[][]=new int[1000][40],fin;
/*     props--->     0=choice of draw item
               1=red
               2=blue
               3=green
               4=thickness
               5=height
               6=x1     |
               7=y1     | of the chosen
               8=x2     | component
               9=y2     |
     genproperties(){
          super("General Properties");
          try{
          temp = new FileOutputStream("Z:\temp.txt");
          }catch(FileNotFoundException _ex){}
          setSize(270,695);
          setLocation(10,45);
          setResizable(false);
          setLayout(null);//new FlowLayout());
          setBackground(Color.gray);
//GENERAL PROPERTIES OF ALL DRAWING COMPONENTS <LOOKS>-------------------
//Color of individual components
          red=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
          blue=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
          green=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
          Label lc=new Label("CHOSEN COLOR",Label.CENTER);
//thickness and height of individual components
          thickness=new Scrollbar(Scrollbar.HORIZONTAL,0,1,1,6);
          height=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
          th=new Label("Thickness=0");
          he=new Label("Height=0");
//Individual components
          SelectRect=new Button("Select Rectangle");
          SelectPoly=new Button("Select Polygon");
          DrawRect=new Button("Rectangle");
          DrawPoly=new Button("Polygon");
          DrawCircle=new Button("Circle");
          DrawLine=new Button("Line");
          Pencil=new Button("Pencil");
          Plotter=new Button("Plotter");
          r=new Label("RED=0");
          g=new Label("BLUE=0");
          b=new Label("GREEN=0");
          colour=new Canvas();
          red.setBounds(5,50,256,15);
          blue.setBounds(5,100,256,15);
          green.setBounds(5,150,256,15);
          colour.setBounds(50,210,170,100);
          lc.setBounds(50,330,170,30);
          r.setBounds(80,70,70,20);
          b.setBounds(77,120,70,20);
          g.setBounds(75,170,75,20);
          thickness.setBounds(30,380,200,15);
          height.setBounds(5,430,256,15);
          th.setBounds(80,400,100,20);
          he.setBounds(90,450,100,20);
//Chosen color display
          colour.setBackground(Color.black);
          r.setBackground(Color.gray);
          b.setBackground(Color.gray);
          g.setBackground(Color.gray);
          SelectRect.setBounds(20,500,100,30);
          SelectPoly.setBounds(150,500,100,30);
          DrawLine.setBounds(20,530,100,30);
          DrawRect.setBounds(150,530,100,30);
          DrawPoly.setBounds(20,560,100,30);
          DrawCircle.setBounds(150,560,100,30);
          Pencil.setBounds(20,590,100,30);
          Plotter.setBounds(150,590,100,30);
          add(red);
          add(blue);
          add(green);
          add(colour);
          add(lc);
          add(r);
          add(g);
          add(b);
          add(thickness);
          add(th);
          add(height);
          add(he);
          add(SelectRect);
          add(SelectPoly);
          add(DrawLine);
          add(DrawRect);
          add(DrawPoly);
          add(DrawCircle);
          add(Pencil);
          add(Plotter);
          thickness.addAdjustmentListener(this);
          height.addAdjustmentListener(this);
          //colour.setBackground(Color.red);
          red.addAdjustmentListener(this);
          blue.addAdjustmentListener(this);
          green.addAdjustmentListener(this);
          SelectRect.addActionListener(this);
          SelectPoly.addActionListener(this);
          DrawLine.addActionListener(this);
          DrawRect.addActionListener(this);
          DrawPoly.addActionListener(this);
          DrawCircle.addActionListener(this);
          Pencil.addActionListener(this);
          Plotter.addActionListener(this);
//To escape array from getting into nullpointer exception.....
          /*int j=0;
          for(i=0;i<1000;i++){
               for(j=0;j<6;j++){
                    props[i][j]=0;
     public void paint(Graphics g){
          setBackground(Color.gray);
          g.setColor(Color.black);
          g.fillRect(40,200,190,120);
     public void adjustmentValueChanged(AdjustmentEvent ae){
          colour.setBackground(new Color(red.getValue(),green.getValue(),blue.getValue()));
          r.setText("RED="+new Integer(red.getValue()).toString());          
          b.setText("BLUE="+new Integer(blue.getValue()).toString());          
          g.setText("GREEN="+new Integer(green.getValue()).toString());     
          th.setText("Thickness="+new Integer(thickness.getValue()).toString());
          he.setText("Height="+new Integer(height.getValue()).toString());
//Array props being initialized to store attribute values of
//individual components to feed into file for later use......
          props[1]=red.getValue();
          props[i][2]=blue.getValue();
          props[i][3]=green.getValue();
          props[i][4]=thickness.getValue();
          props[i][5]=height.getValue();
          //System.out.println("Ch:"+props[i][0]+" R:"+props[i][1]+" B:"+props[i][2]+" G:"+props[i][3]+" Th:"+props[i][4]+" He:"+props[i][5]+" i:"+i);
     public void actionPerformed(ActionEvent e){
          if(e.getActionCommand()=="Pencil"){
               i=++i;
               choice=7;
          if(e.getActionCommand()=="Line"){
               choice=6;
               i=++i;
          if(e.getActionCommand()=="Circle"){
               choice=5;
               i=++i;
          if(e.getActionCommand()=="Polygon"){
               choice=4;
               i=++i;
          if(e.getActionCommand()=="Rectangle"){
               choice=3;
               i=++i;
          if(e.getActionCommand()=="Select Polygon"){
               choice=2;
               i=++i;
          if(e.getActionCommand()=="Select Rectangle"){
               choice=1;
               i=++i;
          if(e.getActionCommand()=="Plotter"){
               choice=0;
               i=++i;
          /*try{
               temp.write(props[i][0]);
               temp.write(props[i][1]);
               temp.write(props[i][2]);
               temp.write(props[i][3]);
               temp.write(props[i][4]);
               temp.write(props[i][5]);
               temp.close();
          }catch(IOException _ex){}*/
          props[i][0]=choice;
          props[i][1]=red.getValue();
          props[i][2]=blue.getValue();
          props[i][3]=green.getValue();
          fin=i;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.io.*;
import java.lang.Math;
public class deathscreen extends Frame implements MouseListener,MouseMotionListener{
     int x1=0,x2=0,y1=0,y2=0;
     genproperties gen=new genproperties();
     int xtemp=0,ytemp=0;
     //boolean flicker=true;
     Image buffer;
     Graphics gg;
     deathscreen(){
          super("Canvas");
          setSize(500,500);
          setResizable(true);
          setLocation(280,45);
          setLayout(new FlowLayout());
          setVisible(true);
          buffer=createImage(500,500);
          gg=buffer.getGraphics();
          gen.setResizable(false);
          gen.setVisible(true);
          addMouseListener(this);
          addMouseMotionListener(this);
     public void update(Graphics g)
          paint(g);
     public void paint(Graphics g){
          int rmin=1,gmin=0,bmin=0,thmin=0,hemin=0;
          setBackground(Color.black);          
          gg.setColor(Color.black);
          gg.fillRect(0,0,500,500);
          for(int i=0;i<=gen.i;i++){
               rmin=(gen.props[i][1]/256)*(256-gen.props[i][5]);
               bmin=(gen.props[i][2]/256)*(256-gen.props[i][5]);
               gmin=(gen.props[i][3]/256)*(256-gen.props[i][5]);
               gg.setColor(new Color(gen.props[i][1],gen.props[i][3],gen.props[i][2]));
               gg.drawString("Nags Project1",20,30);
               if(gen.props[i][0]==6){
                    gg.drawLine(gen.props[i][6],gen.props[i][7],gen.props[i][8],gen.props[i][9]);
                    for(int lc=0;lc<gen.props[i][4];lc++){
                         gg.setColor(new Color(gen.props[i][1]+rmin,gen.props[i][3]+gmin,gen.props[i][2]+bmin));
                         rmin=++rmin;
                         bmin=++bmin;
                         gmin=++gmin;
                         gg.drawLine(gen.props[i][6]+lc,gen.props[i][7]+lc,gen.props[i][8]+lc,gen.props[i][9]+lc);
                         gg.drawLine(gen.props[i][6]-lc,gen.props[i][7]-lc,gen.props[i][8]-lc,gen.props[i][9]-lc);
               else if(gen.props[i][0]==3){
                    if(gen.props[i][6]>gen.props[i][8] && gen.props[i][7]<gen.props[i][9]){
                         gg.drawRect(gen.props[i][8],gen.props[i][7],gen.props[i][6]-gen.props[i][8],gen.props[i][9]-gen.props[i][7]);
                    else
                    if(gen.props[i][7]>gen.props[i][9] && gen.props[i][6]<gen.props[i][8]){
                         gg.drawRect(gen.props[i][6],gen.props[i][9],gen.props[i][8]-gen.props[i][6],gen.props[i][7]-gen.props[i][9]);
                    else
                    if(gen.props[i][6]<gen.props[i][8] && gen.props[i][7]<gen.props[i][9]){
                         gg.drawRect(gen.props[i][6],gen.props[i][7],gen.props[i][8]-gen.props[i][6],gen.props[i][9]-gen.props[i][7]);
                    else
                    if(gen.props[i][6]>gen.props[i][8] && gen.props[i][7]>gen.props[i][9]){
                         gg.drawRect(gen.props[i][8],gen.props[i][9],gen.props[i][6]-gen.props[i][8],gen.props[i][7]-gen.props[i][9]);
               else if(gen.props[i][0]==5){     
                    if(gen.props[i][6]>gen.props[i][8] && gen.props[i][7]<gen.props[i][9]){
                         gg.drawOval(gen.props[i][8],gen.props[i][7],gen.props[i][6]-gen.props[i][8],gen.props[i][9]-gen.props[i][7]);
                    else
                    if(gen.props[i][7]>gen.props[i][9] && gen.props[i][6]<gen.props[i][8]){
                         gg.drawOval(gen.props[i][6],gen.props[i][9],gen.props[i][8]-gen.props[i][6],gen.props[i][7]-gen.props[i][9]);
                    else
                    if(gen.props[i][6]<gen.props[i][8] && gen.props[i][7]<gen.props[i][9]){
                         gg.drawOval(gen.props[i][6],gen.props[i][7],gen.props[i][8]-gen.props[i][6],gen.props[i][9]-gen.props[i][7]);
                    else
                    if(gen.props[i][6]>gen.props[i][8] && gen.props[i][7]>gen.props[i][9]){
                         gg.drawOval(gen.props[i][8],gen.props[i][9],gen.props[i][6]-gen.props[i][8],gen.props[i][7]-gen.props[i][9]);
               else if(gen.props[i][0]==7){
                    //gg.drawLine(gen.props[i][6],gen.props[i][7],gen.props[i][6]+5,gen.props[i][7]+5);
          /*if(!flicker){
               screengc.drawImage(buffer,0,0,null);
          g.drawImage(buffer,0,0,this);
//MOUSE COMPONENTS--------------------------------------------------------------------------------------------------
     public void mouseClicked(MouseEvent me){
     public void mouseEntered(MouseEvent me){  }
     public void mouseExited(MouseEvent me){  }
     public void mousePressed(MouseEvent me){
          x1=me.getX();
          y1=me.getY();
          gen.props[gen.i][6]=me.getX();
          gen.props[gen.i][7]=me.getY();
          //repaint();
     public void mouseReleased(MouseEvent me){ 
          x2=me.getX();
          y2=me.getY();
          gen.props[gen.i][8]=me.getX();
          gen.props[gen.i][9]=me.getY();
          gen.i=++gen.i;
          gen.props[gen.i][0]=gen.props[gen.i-1][0];
          gen.props[gen.i][1]=gen.red.getValue();
          gen.props[gen.i][2]=gen.blue.getValue();
          gen.props[gen.i][3]=gen.green.getValue();
          repaint();
     public void mouseDragged(MouseEvent me){
          x2=me.getX();
          y2=me.getY();
          gen.props[gen.i][8]=me.getX();
          gen.props[gen.i][9]=me.getY();
          //flicker=false;
          repaint();
     public void mouseMoved(MouseEvent me){ 
          //flicker=true;
im not able to have a 3D feel in the program where i draw the objects,
when i try to use a loop and draw and redraw i am unable and i get a null pointer exception......wat do i do???

im not able to have a 3D feel in the program where i draw the objects,What do you mean 'a 3D feel'? Nothing in your code seems to be doing anything other than using standard awt widgets, and drawing 2D shapes, so why would it be 3D?
or do you mean it's using the Java look and feel rather than the platform one?
when i try to use a loop and draw and redraw i am unable and i get a null pointer exception......wat do i do???repost the relevent code using [code] [[i]code] tags.
Pete

Similar Messages

  • Is Eclipse a 100% pure Java program?

    Is Eclipse a 100% pure Java program?

    Eclipse runs on linux, windows, MAc OS X and I think a few others. It has native widgets via SWT for those platforms using the native OS Look and Feel. It is smoother than Swing in most ways, yet Swing does have some advantages as well. SWT is a nice kit. It would be nice if the Swing Team took the idea of building a cross platform native GUI kit into the AWT/Swing layer so that Swing was even faster. I think Swing and SWT are great, only I wish Swing had provided what SWT does (in some ways) so that Swing would have been used and SWT never written. It's a shame, but then again, perhaps it promotes the Swing Team to make Swing better/faster.
    Look at Swing on Mac OS X, it is very nice, looks like native OS (because Apple wrote their own L&F for Mac OS X Only), but it is faster than Swing on Windows/Linux.

  • 100% Pure Java Program

    I have seen that the 100% Pure Java Program has "completed the Sun End of Life process and it is no longer supported by Sun" (see http://java.sun.com/100percent/).
    Can anyone explain to me why is this, and what alternatives do we have now to be Java Certified (if any)?
    Thanks.

    It's disturbing but probably not end of the world.
    I like this:
    "Any use of product on this page is at the sole discretion of the developer and Sun assumes no responsiblity for any resulting problems."
    Do they mean that jdk 1.4 is bugless and they are resposible for any problems if something happens?
    I do not think so.

  • Setting persitent system environment variables using java program

    hai,
    Iam tryng to write installation for an application,which require to set some persistent system environment variables using java program. I have tried using set command Runtime.getRuntime().exec("cmd /c set blah blah "),but this applies only to that particular DOS promt only,i presume.And this is not perisistent.please do help.
    Biju

    The solution I proposed worked only on Windows XP/2003.
    The following solution will work on Windows NT/2000/XP/2003 with JDK 1.2+.
    1- Download the [url http://www.gjt.org/download/time/java/jnireg/registry-3.1.3.zip]JNIRegistry zipped archive.
    2- Open the registry-3.1.3.zip file and extract in the folder of your choice ( Eg. c:\setenv ) only the 2 first files (when sorted by path): ICE_JNIRegistry.dll and registry.jar.
    You don't need to keep the folder tree in the extraction.
    3- Create the following SetEnv.java file in the same folder ( Eg. c:\setenv ).
    import com.ice.jni.registry.Registry;
    import com.ice.jni.registry.RegistryKey;
    import com.ice.jni.registry.RegStringValue;
    import com.ice.jni.registry.RegistryValue;
    public class SetEnv
        static final String REG_HKLM_SUBKEY_NAME = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
        public static void main(String[] args)
        throws Exception
            new SetEnv().exec(args);
        void exec(String[] args)
        throws Exception
            if (args.length != 2)
                throw new IllegalArgumentException("\n\nUsage: java SetEnv {varName} {varValue}\n\n");
            String varName = args[0];
            String varValue = args[1];
            RegistryKey key = null;
            RegStringValue value;
            try
                key = Registry.HKEY_LOCAL_MACHINE.openSubKey(REG_HKLM_SUBKEY_NAME, RegistryKey.ACCESS_ALL);
                value = new RegStringValue(key, varName, RegistryValue.REG_EXPAND_SZ);           
                value.setData(varValue);
                key.setValue(value);
                key.flushKey();
            finally
                try { key.closeKey(); }
                catch (Exception e) {}
    }4- Compile it.
    javac -classpath .;registry.jar SetEnv.java
    5- Run it. varName and varValue are strings of your choice.
    java -classpath .;registry.jar -Djava.library.path=. SetEnv varName varValue

  • Setting windows environment variables from Java program

    Is there any way to set environment variables from Java program in Windows? Any help is appreciated.
    Here is my situation:
    I need to decrypt an encrypted Oracle user password in a batch file which will be used while running a sql script with sqlplus. I was planning to have bat file which will call a Java program decrypt the password and set it as an env variable in windows which will be available while calling sqlplus.
    thanks

    Runtime.exec has a lot of overloadings. Two of them
    allows you to specify the environment variables.
    exec
    public Process exec(String[] cmdarray,
    String[] envp,
    File dir)
    throws IOExceptionExecutes the specified command and
    arguments in a separate process with the specified
    environment and working directory.
    cmdarray - array containing the command to call and
    its arguments.
    envp - array of strings, each element of which has
    environment variable settings in format name=value.
    dir - the working directory of the subprocess, or null
    if the subprocess should inherit the working directory
    of the current process.
    I had this sample program:
    public class SetVarExample {
    public static void main (String[] args) throws Exception {
         String[] cmd_env= new String[] {"password="+"ABCD","Path=C:\\Sun\\AppServer\\jdk\\bin"};
         String cmd = "cmd /c SET ";
         Runtime.getRuntime().exec(cmd,cmd_env);
    System.out.println( "Finish ...." );
    I tried it in a command prompt. But looks like when the program exits, it's a whole new process and so it does not retain the env variables set in the java program.
    Any suggestions? Am I doing it worng?
    thanks

  • How to create a setup.exe from a pure java program

    i have some program using pure Java Swing.... i already created jar files to make it executable everytime you click on the icon... but i want to create a installer type like setup.exe just like in VB....
    How on earth can I do that?!?
    Thanks!

    This is one...
    http://www.excelsior-usa.com/jet.html
    And there are a lot more like jexe n stuff.
    But look out. Only some convert it to pure native
    form. The rest are only launchers - you would still
    need a JRE to run yer program.
    extremely sorry. Didnt read the post properly .Sorry

  • How to set environment variables using java program

    Hi all
    I want to set environment variables on windows 98/200/xp system, such as path and classpath using a java program.
    How to do this using a java program.
    Any body plz helppppppppp.

    #1 05-02-2003, 07:38 AM
    Goodz13 Join Date: Jan 2002, Posts: 985
    Location: Halifax, NS, Canada
    Reputation:
    Java FAQ's and tutorials
    Java FAQ's
    Path and ClassPath:
    PATH
    In Windows 9x you would set it up in the autoexec.bat file
    ie.
    SET PATH=%PATH%;c:\jdk1.4.2\bin\;
    where c:\jdk1.4.2\ is the path where you installed Java.
    In Windows 2000 and XP
    Right click on My Computer->Properties->Advanced Tab->Environment Variables... Button.
    If you see a PATH in System Variables, click that and edit it. If you don't, you will need to create a new System variable.
    It should look something like this:
    %SystemRoot%\system32;%SystemRoot%;c:\jdk1.4.2\bin\;
    Any querry email me to [email protected]
    Answer by
    Rajasekhar Goli
    DS UNICS Infotech

  • Machine environment for running a java program

    Hi,
    I am thinking about writing a client-server application. The communication between the server and the client and vice versa will be in RMI. My question is regarding the client machine environment - do I need to install JDK on the client machine in order to run the client? Can the client run on any environment?
    Thanks

    Hi,
    I am thinking about writing a client-server
    application. The communication between the server and
    the client and vice versa will be in RMI. My question
    is regarding the client machine environment - do I
    need to install JDK on the client machine in order to
    run the client? Can the client run on any environment?
    ThanksHow do java programs run?
    Compiled Java programs are stored in files as bytecode. As a Java program is running, the Java Virtual Machine (JVM), which is a piece of software, converts the bytecode into machine executable code for the particular platform on which the program is running. This code is what is executed by the processor. Bytecode is not specific to a particular platform, but the machine code generated by the JVM is.
    [url http://www.webopedia.com/TERM/J/JVM.html] definition of JVM as per webopedia[ [/url]
    Hopefully now you have an answer to your question.

  • A JAVA PROGRAM TO CONTROL SYSTEM EVENTS OF WIDOWS environment

    Hello everyone.
    The question is: can I develop a java program that can control system events of a windows environment? For example a program to shut down the computer, log off or open and close windows applications?
    If so, how can i do that??
    please help me. Your help is appreciated in advance.
    thanks.
    Wakariuki

    Hi,
    If you want to make native calls, you can use JNI (Java Native Interface).
    Using JNI, you call call any C/C++ funtions.
    Please visit, http://java.sun.com/docs/books/jni/ for JNI structure. To program using JNI, read the book given in the link. It is very useful for beginners.

  • Java program in UNIX environment

    Hi All,
    Could you please help me with how to configure a java program in UNIX environment..
    that is to schedule it to run every day from cron..
    I need to know what are the basic things we require to achieve the above..
    I guess it is:
    A script
    A config file containing db login details
    oher than this I don?t know what is required plz help

    You can execute any jar or class file with cron. If you are using a jar you might use something like java -jar /usr/bin/myapp.jar .
    I use Linux, this is my area of expertise.
    Here is an online guide "for complete newbies" on how to set up cron.
    http://www.unixgeeks.org/security/newbie/unix/cron-1.html
    Hope it helps.

  • How do i get value of Environment variables from a java program?

    Hai,
    I have a setup file wherein i set the path for the root directory , in the following way.
    setenv TPEROOT "/home/systpe/khurram/changes"
    when i give echo $TPEROOT
    the path , home/systpe/khurram/changes , is displayed on the console
    If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
    I want to use the value of the environment variable in my program.
    Any help in this regard would be very useful
    Thanks
    khurram

    java -DTPEROOT=$TPEROOT my&#337;ackage.myclass myargs

  • Can I run my java program in windows environment?

    How can i make my compiled java program run into windows environment?
    What program will i use to be able to do that?

    1. Install the JRE.
    2. Go to the command line.
    3. Type something like java myClass or java -jar myJar.jar.
    You could also use one of the many java2exe (java to executable) programs floating out there.

  • I want to run java program on windows environment as background process

    Hi all
    I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
    for example look this programe
    import java.io.*;
    import java.util.*;
    public class TestClass {
         class ravi extends Thread{
              public void run(){
                   try {    
                        String target_file = "ravind.txt";
                        File targetfile = new File(target_file);
                        PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
                   for (int i =0 ; i < 100 ;i++ ){
                        Thread.sleep(10000);
                        writer.println(" ravindra shukla ");
              } catch (Exception e) {               
                             e.printStackTrace();
         public static void main(String[] args) {
              TestClass test1 = new TestClass();
              TestClass.ravi r1 = test1.new ravi();
              r1.start();          
    System.out.println(" return from main ");
    first i compile this
    javac TestClass.java
    then i run this by using this command
    java TestClass
    but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java command

    Thanks dude
    This solution �start java TestClass� works fine �. But it does not solve my problem
    It opens another black window and that black window persist till the life time of my program
    Is it possible application run on complete background without opening another black window �as in Linux

  • Disabling the keys with my Java Program

    I have a program that extends a JWindow. I would like to make this program my destop, as in disabling all function keys on the keyboard including ctrl+alt+del and others like that.
    Some Internet cafe shops use this technique to restrict unauthorised customers from accessing their PCs.
    If anyone knows how, please help.
    Thanks in advance.

    Keys that are listened to by the Window Environment cannot be intercepted with Java alone. This include Ctrl-Alt-Del, as well as Alt-Tab for MS Windows. You would need JNI to do this.
    If you use Linux, you could do it in pure Java, with one exception. Ctrl-Alt-Del would terminate X, and bring you to a console login. You may be able to disable that somewhere in the X configuration. This would prevent anyone from getting access to the system, unless they have the login for it. To do this you would need to setup X so it starts without the Gnome/KDE Desktop Manager, and runs your full screen Java app instead.

  • Running a Java program on HP UX

    Hi everyone
    First time in life i have to make a Java program run on HP UX... the program is running perfectly in windows environment..... but when i copy the program to HP-UX and try to run it gives me following error
    -----------------End Configuration-------------------------
    Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/Savepoint
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$1(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:177)
    at StatInterface.main(StatInterface.java:58)
    I can guess that this has something to do with Class path or java home... i even don't know how to set paths in HP-UX
    can u ppl help me?
    Following are the details
    OS Version = HP-UX rpsvr02 B.11.11 U 9000/800 (ta)
    JVM = java version "1.3.1.02" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.02-011206-02:17) Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.02-JPSE_1.3.1.02_20011206 PA2.0, mixed mode)
    $PATH value
    .:/home/express/bin:/home/express/bin:/home/express/BIN:/usr/local/bin:/opt/java1.3/bin:/home/oracle/product/9.2.0.1.0/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/mx/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/scr/bin://opt/perl/bin:/usr/sbin/diag/contrib:/opt/hpnpl//bin:/usr/bin/X11:/usr/sbin:/opt/java1.3/bin
    I really need your help.. and it is really urgent.. plz
    Thanx in advance

    In the documentation for Savepoint it states "since 1.4"
    You need a more recent version of java. I suggest using asupported version like 1.4.2_08 or 1.5.0_04 if you can get them.
    If not try getting the source for 1.6.0 and compiling it for HPUX.

Maybe you are looking for

  • Need option to list books by File Name

    With a good number of books added to ADE, it's sometimes impossible to identify the book from the thumbnail, if it's just the first page of text, for example, and not all pdfs populate the "Title" field either, especially homegrown pdfs. So if Adobe

  • Sales order uploading through bapi

    hi i want to upload sales order to bapi pls give the code and i also error handling through bapi regards A.K

  • "There was not enough memory" error, DNG conversion.

    I have CS4 and I like to convert my files to dng, however, I can't seem to do it on multiple raw files, because after fifty or so, I get the message, Incomplete because 'There was not enough memory.' I originally thought this may have had something t

  • LIMEWIRE - NEED HELP PLEASE

    Hello, I'm new to macs but I've love it and will never go back. A friend suggested the limewire site. I've downloaded one item only and now have read this forum about Limewire. I'm not tech savvy by anymeans but can someone tell me how to check to se

  • Coldfusion doesnt parse code when script is requested by flash

    I have coldfusion developer running on my localhost as a module in apache. I have an swf that calls a cfm file that pulls from the database and outputs xml. When I request the cfm file using a browser, coldfusion does its thing. But when I call the c