Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: pls help

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post pls help

    //i need to get app to print running in my console
    code bellow//





    package thepackage.moonrunner;




    import java.awt.Container;






    import javax.swing.*;
    //window creation start
    public class UserFrame extends JFrame {
    UserFrame(){
    setTitle("MoonRunner");
    setSize (400,300);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
    }

    public static void main(String[] args){
    UserFrame f = new UserFrame();
    Container cp = f.getContentPane();
    }
    //window creation end
    public class Game implements Runnable {
    private Thread thread;
    private boolean running = false;

    public synchronized void start() {
    running = true;
    thread = new Thread((Runnable) this,"Display");
    thread.start();

    }

    public void run() {
    while (running) {
    System.out.println("running");
    }
    }
    public synchronized void stop() {
    running = false;

    }
    }
    }


  2. #2
    Junior Member
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: pls help

    Ask in detail actually what you want to do...this code just creates frame of size 400,300 and does nothing

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: pls help

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Please post your code correctly per the above link and ask a specific question.

Similar Threads

  1. help me pls
    By ayki in forum Java Theory & Questions
    Replies: 3
    Last Post: September 2nd, 2013, 08:50 PM
  2. Pls help
    By avi11 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 21st, 2013, 04:43 AM
  3. HI PLS HELP
    By Virat Pandey in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 23rd, 2012, 06:12 AM
  4. Pls Help
    By randika11 in forum JDBC & Databases
    Replies: 3
    Last Post: July 20th, 2010, 05:52 AM
  5. pls help me
    By sandeep_636338fae in forum Java Theory & Questions
    Replies: 1
    Last Post: January 4th, 2010, 04:03 PM

Tags for this Thread