Results 1 to 7 of 7
  1. #1
    Arjan is offline Member
    Join Date
    Aug 2013
    Location
    The Netherlands
    Posts
    1
    Rep Power
    0

    Question HELP needed for code

    Hi, I wrote my first code about 4 years ago. I want the code in a simple GUI but I can't find a way to do it. Here's the code

    /*
    * om dit te veranderen ga naar Tools.
    * en open de template editor
    */
    package javaapplication1;

    /**
    * De hallo wereld Application is zeer simpel en maakt
    * alleen een display van 'Hallo Wereld!'
    */
    public class JavaApplication1{

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    System.out.println("Hallo Camiel,");
    System.out.println("Ik ben Arjan en ik heb nu wat geprobeert");
    System.out.println("met Java Applications. Dus ik heb nu");
    System.out.println("een som gemaakt die toch wel ietsje moeilijker");
    System.out.println("is dan anderen. kijk maar eens toe");


    float a;
    float b;
    float c;
    float d;
    float e;
    a = (float) 1.3;
    b = (float) 1.75;
    c = (float) 3.9;
    d = (float) 2.4 ;
    e = (float) ( a * b / c + d);
    System.out.println("(1.3 * 1.75) / 3.9 + 2.4 = " + e);


    System.out.println("dit was mijn som en ik deed er eventjes over,");
    System.out.println("maar het is me wel gelukt dus.");
    System.out.println("ik ga denk ik maar eens opzoeken hoe ik delay");
    System.out.println("programeer via java, zodat ik tijd heb tussen");
    System.out.println("elke regel enzo. bedankt voor de hulp die je me");
    System.out.println("geeft in het computer gebied");
    System.out.println("groetjes, Arjan!");

    }
    }

    Now I want to open a program, have a button which runs the code above and then displays it into a jLabel. PLEASE HELP

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: HELP needed for code

    Please go through the Forum Rules, particularly the third paragraph. Then go through the Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

    To change the subject line, click 'Edit Post' and then 'Go Advanced'

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: HELP needed for code

    You can learn about creating a Swing GUI here: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    If you prefer JavaFX, you can find that here: JavaFX Documentation Home | JavaFX 2 Tutorials and Documentation

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,354
    Rep Power
    6

    Default Re: HELP needed for code

    I don't get it. If I type "java gui" into Google I get volumes of information. Its impossible to NOT find a way to do it :/
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default Re: HELP needed for code

    Quote Originally Posted by gimbal2 View Post
    Its impossible to NOT find a way to do it
    True but it is way easier to hope someone else will do it for you.

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,354
    Rep Power
    6

    Default Re: HELP needed for code

    Quote Originally Posted by Junky View Post
    True but it is way easier to hope someone else will do it for you.
    I agree that people tell themselves it is true. Of course we know it is not, its far easier and quicker to type a few words into google rather than sign up to a forum, post a question, wait, weed through the responses for the one that spoonfeeds the answer...
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,773
    Blog Entries
    7
    Rep Power
    21

    Default Re: HELP needed for code

    Quote Originally Posted by Arjan View Post
    System.out.println("Ik ben Arjan en ik heb nu wat geprobeert");
    Argh, the past participle of 'proberen' is 'geprobeerd'; I couldn't resist but this makes me itchy ...

    kind regards,

    Jos (<-- I'll take my pills now, promised)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Testing multithreading code needed!
    By heatblazer in forum Advanced Java
    Replies: 3
    Last Post: 05-09-2013, 10:07 AM
  2. Help needed with custom code
    By Joskhuu in forum New To Java
    Replies: 1
    Last Post: 02-17-2012, 12:37 AM
  3. needed a code for this
    By rajivjoshi in forum New To Java
    Replies: 2
    Last Post: 08-01-2010, 01:26 PM
  4. needed code for this output
    By rajivjoshi in forum New To Java
    Replies: 4
    Last Post: 05-31-2010, 06:54 PM
  5. Hi code needed for JCA adaptor
    By lavanya82 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-04-2009, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •