GUI programming in java

Is there any method on toolkit class that centers the window on the user's desktop?

No, but there are methods to retrieve the dimensions of the users screen. You then can do the math necessary to center the frame or window.

Similar Messages

  • Client-Server side GUI programming

    I want to create a client-server side gui programming with java
    i read this web adress
    http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    for information but there are some parts that i didnt understand and wait for your help
    i m trying to build an online-help(live chat) system so when people press the start chat button a java page will appear but i wonder how this will connect to the person who is on server side
    i mean is it possible to 2 users connect the same port and chat with each other
    I mean when user press the chat button the online help supporter will be informed somebody wants to speak with him and they will start a chat
    how can i do something like that
    any help would be usefull thanks

    Below is an example of a client/server program.
    It shows how the server listens for multiple clients.
    * TriviaServerMulti.java
    * Created on May 12, 2005
    package server;
    * @author johnz
    import java.io.*;
    import java.net.*;
    import java.util.Random;
    * This TriviaServer can handle multiple clientSockets simultaneously
    * This is accomplished by:
    * - listening for incoming clientSocket request in endless loop
    * - spawning a new TriviaServer for each incoming request
    * Client connects to server with:
    * telnet <ip_address> <port>
    *     <ip_address> = IP address of server
    *  <port> = port of server
    * In this case the port is 4413 , but server can listen on any port
    * If server runs on the same PC as client use IP_addess = localhost
    * The server reads file
    * Note: a production server needs to handle start, stop and status commands
    public class TriviaServerMulti implements Runnable {
        // Class variables
        private static final int WAIT_FOR_CLIENT = 0;
        private static final int WAIT_FOR_ANSWER = 1;
        private static final int WAIT_FOR_CONFIRM = 2;
        private static String[] questions;
        private static String[] answers;
        private static int numQuestions;
        // Instance variables
        private int num = 0;
        private int state = WAIT_FOR_CLIENT;
        private Random rand = new Random();
        private Socket clientSocket = null;
        public TriviaServerMulti(Socket clientSocket) {
            //super("TriviaServer");
            this.clientSocket = clientSocket;
        public void run() {
            // Ask trivia questions until client replies "N"
            while (true) {
                // Process questions and answers
                try {
                    InputStreamReader isr = new InputStreamReader(clientSocket.getInputStream());
                    BufferedReader is = new BufferedReader(isr);
    //                PrintWriter os = new PrintWriter(new
    //                   BufferedOutputStream(clientSocket.getOutputStream()), false);
                    PrintWriter os = new PrintWriter(clientSocket.getOutputStream());
                    String outLine;
                    // Output server request
                    outLine = processInput(null);
                    os.println(outLine);
                    os.flush();
                    // Process and output user input
                    while (true) {
                        String inLine = is.readLine();
                        if (inLine.length() > 0)
                            outLine = processInput(inLine);
                        else
                            outLine = processInput("");
                        os.println(outLine);
                        os.flush();
                        if (outLine.equals("Bye."))
                            break;
                    // Clean up
                    os.close();
                    is.close();
                    clientSocket.close();
                    return;
                } catch (Exception e) {
                    System.err.println("Error: " + e);
                    e.printStackTrace();
        private String processInput(String inStr) {
            String outStr = null;
            switch (state) {
                case WAIT_FOR_CLIENT:
                    // Ask a question
                    outStr = questions[num];
                    state = WAIT_FOR_ANSWER;
                    break;
                case WAIT_FOR_ANSWER:
                    // Check the answer
                    if (inStr.equalsIgnoreCase(answers[num]))
                        outStr="\015\012That's correct! Want another (y/n)?";
                    else
                        outStr="\015\012Wrong, the correct answer is "
                            + answers[num] +". Want another (y/n)?";
                    state = WAIT_FOR_CONFIRM;
                    break;
                case WAIT_FOR_CONFIRM:
                    // See if they want another question
                    if (!inStr.equalsIgnoreCase("N")) {
                        num = Math.abs(rand.nextInt()) % questions.length;
                        outStr = questions[num];
                        state = WAIT_FOR_ANSWER;
                    } else {
                        outStr = "Bye.";
                        state = WAIT_FOR_CLIENT;
                    break;
            return outStr;
        private static boolean loadData() {
            try {
                //File inFile = new File("qna.txt");
                File inFile = new File("data/qna.txt");
                FileInputStream inStream = new FileInputStream(inFile);
                byte[] data = new byte[(int)inFile.length()];
                // Read questions and answers into a byte array
                if (inStream.read(data) <= 0) {
                    System.err.println("Error: couldn't read q&a.");
                    return false;
                // See how many question/answer pairs there are
                for (int i = 0; i < data.length; i++)
                    if (data[i] == (byte)'#')
                        numQuestions++;
                numQuestions /= 2;
                questions = new String[numQuestions];
                answers = new String[numQuestions];
                // Parse questions and answers into String arrays
                int start = 0, index = 0;
                   String LineDelimiter = System.getProperty("line.separator");
                   int len = 1 + LineDelimiter.length(); // # + line delimiter
                boolean isQuestion = true;
                for (int i = 0; i < data.length; i++)
                    if (data[i] == (byte)'#') {
                        if (isQuestion) {
                            questions[index] = new String(data, start, i - start);
                            isQuestion = false;
                        } else {
                            answers[index] = new String(data, start, i - start);
                            isQuestion = true;
                            index++;
                    start = i + len;
            } catch (FileNotFoundException e) {
                System.err.println("Exception: couldn't find the Q&A file.");
                return false;
            } catch (IOException e) {
                System.err.println("Exception: couldn't read the Q&A file.");
                return false;
            return true;
        public static void main(String[] arguments) {
            // Initialize the question and answer data
            if (!loadData()) {
                System.err.println("Error: couldn't initialize Q&A data.");
                return;
            ServerSocket serverSocket = null;
            try {
                serverSocket = new ServerSocket(4413);
                System.out.println("TriviaServer up and running ...");
            } catch (IOException e) {
                System.err.println("Error: couldn't create ServerSocket.");
                System.exit(1);
            Socket clientSocket = null;
            // Endless loop: waiting for incoming client request
            while (true) {
                // Wait for a clientSocket
                try {
                    clientSocket = serverSocket.accept();   // ServerSocket returns a client socket when client connects
                } catch (IOException e) {
                    System.err.println("Error: couldn't connect to clientSocket.");
                    System.exit(1);
                // Create a thread for each incoming request
                TriviaServerMulti server = new TriviaServerMulti(clientSocket);
                Thread thread = new Thread(server);
                thread.start(); // Starts new thread. Thread invokes run() method of server.
    }This is the text file:
    Which one of the Smothers Brothers did Bill Cosby once punch out?
    (a) Dick
    (b) Tommy
    (c) both#
    b#
    What's the nickname of Dallas Cowboys fullback Daryl Johnston?
    (a) caribou
    (b) moose
    (c) elk#
    b#
    What is triskaidekaphobia?
    (a) fear of tricycles
    (b) fear of the number 13
    (c) fear of kaleidoscopes#
    b#
    What southern state is most likely to have an earthquake?
    (a) Florida
    (b) Arkansas
    (c) South Carolina#
    c#
    Which person at Sun Microsystems came up with the name Java in early 1995?
    (a) James Gosling
    (b) Kim Polese
    (c) Alan Baratz#
    b#
    Which figure skater is the sister of Growing Pains star Joanna Kerns?
    (a) Dorothy Hamill
    (b) Katarina Witt
    (c) Donna De Varona#
    c#
    When this Old Man plays four, what does he play knick-knack on?
    (a) His shoe
    (b) His door
    (c) His knee#
    b#
    What National Hockey League team once played as the Winnipeg Jets?
    (a) The Phoenix Coyotes
    (b) The Florida Panthers
    (c) The Colorado Avalanche#
    a#
    David Letterman uses the stage name "Earl Hofert" when he appears in movies. Who is Earl?
    (a) A crew member on his show
    (b) His grandfather
    (c) A character on Green Acres#
    b#
    Who created Superman?
    (a) Bob Kane
    (b) Jerome Siegel and Joe Shuster
    (c) Stan Lee and Jack Kirby#
    b#

  • What is the best IDE for database programming in java?

    im just new to java, i have experience in powerbuilder and visual basic. Im looking for an IDE for JAVA Database Programming that have same ease of use of the GUI builder of visual basic and power of the Datawindow in Powerbuilder.
    What is the best IDE for database programming in java?

    hey sabre why not just help me? instead of posting
    annoying replies. You want me to browse all the post
    two weeks ago to find what im looking for. stoopsMost regulars to this forum find X-posting annoying. Since you are lazy and want me to search the posts of the last couple of week for you, I find you very annoying.

  • How to program in java

    hey guys. i am an undergraduate student. graduating next spring 2007. i did all my programming languages which were required in my course in 2004 and since that i have not taken any programming classes. i got my internship as a database administrator so got into MSaccess and Sql and VbA scripting. since my graduation year is near i want to be strong in database and programming and i was just reading about the employers what kind of programming they prefer and most of the times out of 100 you can say 80% needs java. so i have realized if i have my skills good in java and database job wont be any problem. i would like you to tell me about books i can buy from amazon.com or resources on internet from which i can understand the concept of programming again and then once my concept is clear about all the data types and functions i can start learning java. i would like you to tell me good java books also and some advance. the only book i have is the second edition of Java how to program. Thanks alot for all your help.

    The perverbial List:
    Free Tutorials and Such
    Installation Notes - JDK 5.0 Microsoft Windows (32-bit)
    Your First Cup of Java
    The Java� Tutorial - A practical guide for programmers
    New to Java Center
    Java Programming Notes - Fred Swartz
    How To Think Like A Computer Scientist
    Introduction to Computer science using Java
    The Java Developers Almanac 1.4
    Object-Oriented Programming Concepts
    Object-oriented language basics
    Don't Fear the OOP
    Free Java Books
    Thinking in Java, by Bruce Eckel (Free online)
    Core Servlet Programming, by Merty Hall (Free Online)
    More Servlets, by Marty Hall (Free Online)
    A Java GUI Programmer's Primer
    Data Structures and Algorithms
    with Object-Oriented Design Patterns in Java, by Bruno R. Preiss
    Introduction to Programming Using Java, by David J. Eck
    Advanced Programming for the Java 2 Platform
    The Java Language Specification
    Books:
    Head First Java, by Bert Bates and Kathy Sierra
    Core Java, by Cay Horstmann and Gary Cornell
    Effective Java, by Joshua Bloch
    Enjoy
    JJ

  • GUI overlaping shapes - Java problem

    Hello!
    I've recently started learning about building GUI's in java, most things have gone well, however there's one thing I havn't managed to solve on my own.
    If you execute the program below (which at the moment is nothing but an empty GUI layout), you'll see a green box that shows for about 0,2 seconds before it's overlaped by the rest of the GUI. What I'm trying do is to place the green box in (or above) the yellow label and since I can't figure out how to do it, I'd be more than happy with a helping hand or two.
    Thanks in advance!
    import java.awt.*;
    public class displayapp{
    public static void main(String[] args){
    GUI layout = new GUI();
              layout.show();
    class GUI extends Frame{
         public GUI(){
    this.setSize(250,500);
    this.setVisible(true);
    //Delete the next four (4) rows if you wish to see the green rectangle I would like to have placed above/inside of the yellow label.
         setLayout(new GridLayout(2,1));
         setBackground(Color.black);
         add(new Display());
         add(new Text());
         public void paint(Graphics g){
    g.setColor(Color.green);
    g.fillRect(40,100,170,170);
    super.paint(g);
    class Display extends Panel{
         public Display(){
         GridBagLayout dlayout = new GridBagLayout();
         setLayout(dlayout);
         GridBagConstraints constraints1 = new GridBagConstraints();
         constraints1.anchor = GridBagConstraints.NORTH;
         constraints1.fill = GridBagConstraints.BOTH;
         constraints1.weighty = 250;
         resize(250, 250);
         Label d1 = new Label();
         d1.setBackground(Color.blue);
         add(d1);
         constraints1.weightx = 15;
         dlayout.setConstraints(d1, constraints1);
         Label d2 = new Label("<the rectangle>");
         d2.setBackground(Color.yellow);
         add(d2);
         constraints1.weightx = 220;
         dlayout.setConstraints(d2, constraints1);
         Label d3 = new Label();
         d3.setBackground(Color.blue);
         add(d3);
         constraints1.weightx = 15;
         dlayout.setConstraints(d3, constraints1);
    class Text extends Panel{
         public Text(){
         GridBagLayout tlayout = new GridBagLayout();
         setLayout(tlayout);
         GridBagConstraints constraints2 = new GridBagConstraints();
         constraints2.anchor = GridBagConstraints.NORTH;
         constraints2.fill = GridBagConstraints.BOTH;
         constraints2.weighty = 250;
         resize(250, 250);
         Label t1 = new Label();
         t1.setBackground(Color.orange);
         add(t1);
         constraints2.weightx = 125;
         tlayout.setConstraints(t1, constraints2);
         Label t2 = new Label();
         t2.setBackground(Color.red);
         add(t2);
         constraints2.weightx = 125;
         tlayout.setConstraints(t2, constraints2);
    }

    Ok...
    Here's an update of the code. I thought the problem might be solved by replacing the graphics in the paint method with graphics2D shapes and use the AWTPermission ("readDisplayPixels") to lock the oval. Unfortunately it didn't, so if you think you might have a clue, don't hesitate to post it. (:
    Note:
    As you might notice, I've replaced the box (seen in the last example) with an ellipse. I thought it would be easier to work with ovals instead of rectrangles, but obviously it isn't...
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class displayapp{
    public static void main(String[] args){
    GUI layout = new GUI();
              layout.show();
    class GUI extends Frame{
         public GUI(){
    this.setSize(250,500);
    this.setVisible(true);
    //Delete the four(4) following rows if you wish to see the green rectangle I'd like to have placed above/inside of the yellow label.
         setLayout(new GridLayout(2,1));
         setBackground(Color.black);
         add(new Display());
         add(new Text());
         public void paint(Graphics g){
         super.paint(g);
         Graphics2D g2d = (Graphics2D)g;
         Ellipse2D.Double circle = new Ellipse2D.Double(50, 50, 110, 110);
         g2d.setColor(Color.green);
         g2d.fill(circle);
         SecurityManager sm = System.getSecurityManager ();
         sm.checkPermission (new AWTPermission ("readDisplayPixels"));
    class Display extends Panel{
         public Display(){
         GridBagLayout dlayout = new GridBagLayout();
         setLayout(dlayout);
         GridBagConstraints constraints1 = new GridBagConstraints();
         constraints1.anchor = GridBagConstraints.NORTH;
         constraints1.fill = GridBagConstraints.BOTH;
         constraints1.weighty = 250;
         resize(250, 250);
         Label d1 = new Label();
         d1.setBackground(Color.blue);
         add(d1);
         constraints1.weightx = 15;
         dlayout.setConstraints(d1, constraints1);
         Label d2 = new Label("<the rectangle>");
         d2.setBackground(Color.yellow);
         add(d2);
         constraints1.weightx = 220;
         dlayout.setConstraints(d2, constraints1);
         Label d3 = new Label();
         d3.setBackground(Color.blue);
         add(d3);
         constraints1.weightx = 15;
         dlayout.setConstraints(d3, constraints1);
    class Text extends Panel{
         public Text(){
         GridBagLayout tlayout = new GridBagLayout();
         setLayout(tlayout);
         GridBagConstraints constraints2 = new GridBagConstraints();
         constraints2.anchor = GridBagConstraints.NORTH;
         constraints2.fill = GridBagConstraints.BOTH;
         constraints2.weighty = 250;
         resize(250, 250);
         Label t1 = new Label();
         t1.setBackground(Color.orange);
         add(t1);
         constraints2.weightx = 125;
         tlayout.setConstraints(t1, constraints2);
         Label t2 = new Label();
         t2.setBackground(Color.red);
         add(t2);
         constraints2.weightx = 125;
         tlayout.setConstraints(t2, constraints2);
    }

  • Free ide for gui programming

    can someone tell me what's the best free java ide for gui programming?

    No one can answer the question of which one is better. It's like answering the question - is red more beautiful than yellow?
    I can however say that the plugins into eclipse which lets you build swing ui by drag and drop are not mature, and I don't think they work if you modify the code by hand, and then want to go back into "drag % drop" mode. The ui builder in jbuilder is nice, and doesn't clutter the code, and it works even if you have modified the code by hand.
    /kaj

  • Best way for gui programming? swing awt jfc swt ....

    hi,
    i have been programming java for some time but exclusively for web, servlets, jsp etc..
    but now i have to do some �real� gui�s. I have no gui experience , (ok I did some basic examples just to see how things work) but/and I�m not able to determine which way I should go.
    So I did some google search and read some threads here im forum on topics swing vs. awt (or so) and found lot of topics with lot of different opinions(some of them also a little bit out of date) so now im CONFUSED more then ever.
    I read people asking questions like :what is better awt or swing and then getting the perfect technical answers like :
    AWT components are NOT native components. AWT components are Java objects. Particular instances of AWT componets (Button, Label, etc.) MAY use peers to handle the rendering and event handling. Those peers do NOT have to be native components. And AWT components are NOT required to use peers for themselves at all.
    Or
    There are some significant differences between lightweight and heavyweight components. And, since all AWT components are heavyweight and all Swing components are lightweight (except for the top-level ones: JWindow, JFrame, JDialog, and JApplet), these differences become painfully apparent when you start mixing Swing components with AWT components.
    But I don�t care that much(at least not now) about this detail answers.
    I would simply like to know from some experienced gui guru, (due to the fact that we have 2005 and java 1.5) if u would like to learn gui in java quickly and know everything u know now which way would u choose:
    AWT
    JFC
    SWING
    SWT
    And which IDE would u use.
    I simply want to get quickly started and do some basic gui programming ,nothing special, but I would like to avoid that after weeks of doing one, then find out the was the wrong one and again learn the another one.
    TIA Nermin

    try swt vs swing and see what you think, its not really a decision someone else can make for you. as long as you don't try and mix the two, it should be a similar learning curve either way.

  • Compression program in java

    hello all,
    any idea how to write a file compression program in java.
    any help would be appreciated.
    thanx

    The same way you would write a compression program in any other language.
    Open a stream for the file to be compressed
    Open a stream for the compressed file, add a filter-stream (according to your choice of algorithm) to the stream for the compressed file.
    Read from one stream, write to the other.
    For uncompressing, reverse the above. :)
    With java you have some small addenums that are useful, like the java.util.zip classes if it is basic zip-functionality that you want.
    Once all this is done, as sugar on the top, fix a nice gui involving JTable, JTree and other eminent swing-components of your choice.
    A fair bit of warning, if you want to use the JFileChooser for your logical file-view inside a compressed file, you are in for a ride. You will have to make your own FileView and File object. The java.io.File object is badly designed and it will be a long hassle to make it work, but it can be done.
    Yours sincerely
    Peter Norell

  • Starting Cobol program from JAVA

    Hi
    For a school project we have to do a part Java & a part cobol
    The COBOL programmes are all to read CSV files into an MS access DB
    Well as a challenge we have to make a buton in the GUI of our JAVA program that starts 1 of these COBOL programes when clicked
    The java program was written/modelled in Together Architect 2006 (eclipse plugin, sry the school forces us to use it) and the COBOL were/are written in percobol from legacyJ
    txn for any help

    i've done that but i seem to not getting the hang of
    it
    from what i get is it something like thhis
    runetime.getRuntime().exec("myCobolprog.cbl");
    yet it doesnt seem to work
    or i just get errors in the IORead this first:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Matlab program to Java application

    Hi, I have to transform a Matlab program to a Java application (with a nice GUI). What's your opinion to the two possibilities:
    1. Calling Matlab out of the java code with a library called com.mathworks.jmi. I don't find much on the net about it. Does anyone know if it works reliable and if I can get the three dimensional plots and present it in my java GUI?
    2. All the existing Matlab scripts have to be rewriten into java. That looks like to much work to me. What would you use to present simple three dimensional bodies? Java 3D? Is there any nice library to use for 3D plots in a xyz coordinate system?
    Thanks!

    Hi,
    I have worked few years back to call Matlab programs from Java. The only option i could find from the resources available then is to write a C program to make a call to this Matlab code, convert this C program to dll file and then call it using Java's JNI api.
    If you feel the back end functionality implemented in Matlab is very complex and time consuming to convert into Java, then i would advice you to code all the UI related stuff in java and then make calls to back end in Matlab to display the info( in the form of graphs). But i should warn you that you should look for the mode to transfer info(like arrays) between Java and Matlab via JNI and dll files, also you should take care of multithreading. I should also warn you that this process is not very good in terms performance and response time.
    But if you need good response time then i would advice you to code everything in Java. Hope this helps!!!

  • NoSuchMethodError in GUI program

    Howdy, I have a GUI program that gets decimal input from the user and converts it to a binary string. It uses JButtons, JTextFields, and JLabels. When I compile and run the program, it says:
    java.lang.NoSuchMethodError: main
    Exception in thread "main"
    I really can't figure it out. I have asked everyone around me that knows anything about java to no avail. Thank you. Any help would be greatly appreciated.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Integer;
    public class binConvertGUI extends JFrame implements ActionListener
           JButton enter = new JButton("Calculate");
           JLabel lbl1 = new JLabel("Enter decimal: ");
           JLabel lbl2 = new JLabel("Binary: ");
           JTextField txt1 = new JTextField(12);
           JTextField txt2 = new JTextField(12);
           JPanel panA = new JPanel();
           JPanel panB = new JPanel();
           String userInA;
           String num;
           int decnum;
           public binConvertGUI()
                  getContentPane().setLayout(
                        new FlowLayout());
                  panA.add(lbl1);
                  panA.add(txt1);
                  panB.add(lbl2);
                  panB.add(txt2);
                  getContentPane().setLayout(
                        new BoxLayout( getContentPane(), BoxLayout.Y_AXIS ));
                  getContentPane().add(panA);
                  getContentPane().add(panB);
                  getContentPane().add(enter);
                  enter.addActionListener(this);
                  txt1.addActionListener(this);
                  enter.setActionCommand("Calculate");
                  txt2.setEditable(false);
           public void actionPerformed(ActionEvent evt)
                  if(evt.getActionCommand().equals("Calculate"))
                        userInA = txt1.getText();
                        decnum = Integer.parseInt(userInA);
                        num = Integer.toBinaryString(decnum);
                        txt2.setText(num);
                  repaint();
           public void main (String[] args) throws NoSuchMethodError
                  binConvertGUI frm = new binConvertGUI();
                  WindowQuitter wquit = new WindowQuitter();
                  frm.addWindowListener( wquit );
                  frm.setSize( 300, 300 );
                  frm.setVisible( true );
    class WindowQuitter extends WindowAdapter
      public void windowClosing( WindowEvent e )
        System.exit( 0 );
    }

    You just forgot the fact that the main() method is always static:
       public static void main (String[] args) throws NoSuchMethodError {
       //...

  • When i click on the Firefox icon I get an error message, C:\Program Files\Java\jre6\lib\deploy\jqs\ff\..\..\..\..\bin\jqsnotify\.exe cannot be found. What is it? and how do i fix it? in English

    When i click on the icon to open Firefox an error message box appears with the following message, C:\Program Files\Java\jre6\lib\deploy\jqs\ff\..\..\..\..\bin\jqsnotify\.exe cannot be found. It then advises me to use the Search function, but the search function says it is unavailable.
    What is it? and how do I fix it? in English

    See:
    http://www.java.com/en/download/help/quickstarter.xml - What is Java Quick Starter (JQS)? What is the benefit of running JQS? - 6.0

  • How to execute external program in java?

    My question is how to execute an external program in java.
    I need to call a unix command in java.
    Thanks.

    it depends on what you are trying to do. Following are the two methods
    1. Runtime.exec() : this method allows you just to call an external program as a seperate process
    2. JNI (Native Interface) :- As of right now only C and C++ are supported by this method. This method allows you to directly call the C/C++ methods from JAVA

  • How Can I execute a java program using java code?

    {color:#000000}Hello,
    i am in great trouble someone please help me. i want to execute java program through java code i have compiled the java class using Compiler API now i want to execute this Class file through java code please help me, thanks in advance
    {color}

    Thanks Manko.
    i think my question was not clear enough.. actually i want to run this class using some java code . like any IDE would do i am making a text editor for java, as my term project i have been able to complie the code usign compiler api and it genertaes the class file but now i want to run this class file "THROUGH JAVA CODE" instead of using Java command. I want to achive it programatically. do you have any idea about it.. thanks in advance

  • How to create a  schedule program in java

    Hello Friends ,
    Can any one provide me with an example how to create a schedule program using java.util.timer etc . I am in need of a program which should run as a schedule job that searches for a file in a directory and read the latest files from that directory in every minute of time as a schedule job .
    Thanks
    mahesh

    I don't feel like writing my own example, but google will be happy to provide you with an example.

Maybe you are looking for

  • Automatic batch creation while making the UD

    Hi Gurus, Due to a customer need, I want to create the batch number for a good's receipt while making the UD, is that possible in a way other than using transaction MSC1N?

  • Save as JPG problem?

    Hi, I have recently been bugged by a problem when saving as JPG. I go through my usual workflow, convert my file to 8bits sRGB, then "save as", select JPG from the drop down, goto my folder and click save. I get the quality dialogue, select 12, hit s

  • How to verify the caching

    My Queries are not caching even i enabled chaching in NQScinfig.ini file. How to verify and resolve the problem. Please suggest the answer.

  • Java.lang.UnsatisfiedLinkError: textureclear

    we have some 3d charts, and one of the user is having some problems with accessing the chart he has JRE 1.5_05 installed and java_home is not set on his machine. we have jnlp file with java3d as library in it like <extension href="http://download.jav

  • Need depth knowledge on these questions

    Hi, 1. Under what circumstances are indexes not used by Oracle while processing queries? 2. Why is comparison of 'null' values directly not possible in SQL? Please share your views..