I need help with some simple code! Please read!

hi everyone.
I'm having problems with a piece of code, and i'd be extremely greatful if somebody could give me a hand with it. I'm totally new to java and have to make a program for my university degree, but i'm finding it extremely difficult, mainly due to my total lack of apptitude for this type of thing. I know this is easy stuff, but the books I have are no use so any help would be greatly appreciated.
I have to write a program which uses two class files. I want one with the code to produce a simple button, and one to invoke it several times at different locations. I decided to write the program as one class file at first, and thought i'd be able to split it up at later. The program works fine when it is one class file. My book said that to split the two classes up, all i needed to do was change the second class to public, although this seems to not work at all. I'm at my wits end on this, and if anyone could correct my code I'd be eternally greatful.
Here is the first class... (sorry about the lack of indentation)
>>>>>>>>>>
import java.awt.*;
import java.applet.Applet;
public class Phone extends Applet {
private Image image;
public void init() {
setLayout(null);
image = getImage(getDocumentBase(), "phone.jpg");}
public void paint (Graphics g) {
g.drawImage(image, 0, 0, 700, 530, this);
PhoneButton myButton;
myButton = new PhoneButton(20,20);
>>>>>>>
This is the second class....
>>>>>>>
public class PhoneButton {
private Button butt;
public PhoneButton(int a, int b, int c){
setLayout(null);
butt = new Button();
butt.setBounds(a,b,20,20);
add(butt);
>>>>>>>>
My compiler generates errors relating to Button, but i can't do anything to please it.
Also, could anyone give me some pointers on how to add a different number or symbol to each button. That is what I added int c for, but i couldn't get it to work.
Cheers in advance.
Michael Morgan

I found that there are 5 error in your code.
1. You should import the "java.awt" package to the PhoneButton.java
2. The PhoneButton is not a kind of Component. You cannot not add it to the Phone class
3. the myButton = new PhoneButton(20, 20) does not provide enough parameters to create PhoneButton
4. You cannot add a Button to a PhoneButton. Becaue the PhoneButton is not a kind of Container
Fixed code:
import java.awt.*;
public class PhoneButton extends Button {
public PhoneButton(int a, int b, int c){
     setBounds(a, b, 20, 20);
     setLabel(String.valueOf(c));
===========================================
import java.awt.*;
import java.applet.Applet;
public class Phone extends Applet {
private Image image;
public void init() {
setLayout(null);
image = getImage(getDocumentBase(), "phone.jpg");}
public void paint (Graphics g) {
g.drawImage(image, 0, 0, 700, 530, this);
PhoneButton myButton;
myButton = new PhoneButton(20,20, 1);
======================
Visual Paradigm for UML - Full Features UML CASE tool
http://www.visual-paradigm.com/

Similar Messages

  • Need help with some simple code

    Hi,
    I'm doing a lab for a class I'm taking and for the most part my code is working properly. It is supposed to accept inputs from the user of ints, doubles, or strings using the Scanner class until the user inputs "quit". It stores each input in array lists of class Integer, Double, and String. It the prints out each element of these in a list and quits the program. The problem is that after I query the user for input, if an int or double is input, the program then requires an input again before it will continue querying. So my question is how do I get it to query only once?
    The code and a copy of what it IS doing, and what it SHOULD do are shown below in bold.
    import java.util.ArrayList;
    import java.util.Scanner;
    import java.lang.Integer;
    import java.lang.Double;
    import java.lang.String;
    public class inputsort
    public static void main()
    int n = 0;
    boolean done = false;
    String quit;
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> intList = new ArrayList<Integer>();
    ArrayList<Double> doubList = new ArrayList<Double>();
    ArrayList<String> stringList = new ArrayList<String>();
    while(!done)
    System.out.print("Enter an int, double, any random text, or type quit to end: ");
    *if (sc.hasNextInt()){*
    intList.add(sc.nextInt());
    sc.next();
    *} else if (sc.hasNextDouble()){*
    doubList.add(sc.nextDouble());
    sc.next();
    *} else {*               
    quit = sc.next();
    *if (quit.equals("quit")) {*
    done = true;
    *else {*
    stringList.add(quit);
    System.out.println("Integers:");
    while(n < intList.size())
    System.out.print("Integer[" + n + "]: ");
    System.out.print(intList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Doubles:");
    while(n < doubList.size())
    System.out.print("Double[" + n + "]: ");
    System.out.print(doubList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Others:");
    while(n < stringList.size())
    System.out.print("Other[" + n + "]: ");
    System.out.print(stringList.get(n) + "\n");
    n += 1;
    Here's what it IS doing:
    Enter an int, double, any random text, or type quit to end: 10
    *10*
    Enter an int, double, any random text, or type quit to end: 1.2
    *1.2*
    Enter an int, double, any random text, or type quit to end: 3.4
    *3.4*
    Enter an int, double, any random text, or type quit to end: 5.6
    *5.6*
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Here is what it SHOULD be doing:
    Enter an int, double, any random text, or type quit to end: 10
    Enter an int, double, any random text, or type quit to end: 1.2
    Enter an int, double, any random text, or type quit to end: 3.4
    Enter an int, double, any random text, or type quit to end: 5.6
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Any help is greatly appreciated!!!
    Thanks!
    Edited by: sublimeph03nix on Jan 21, 2009 7:24 PM

    My professor told me to add sc.next(); because she said when you hit return its reads that in the scanner class too, so it's kinda to clear the buffer I think, I wasn't really sure. It changes nothing on the front end if I remove it.
    As for the thing, it wont let me edit for some reason.  I'll try again in a bit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help with a widget code please

    Hello everyone and Happy Holidays
    I have been trying to learn some simple codes for the widgets and here is one that does some of what I want but I cannot get the line that create the send to an email address work
    <FORM ACTION="/cgi-bin/html/formdump.cgi"
    METHOD="GET" ENCTYPE="application/x-www-form-urlencoded">
    E-mail address: <INPUT TYPE="text" NAME="email" SIZE="20">
    <INPUT TYPE="radio" NAME="abonnement" VALUE="s'abonner" CHECKED> s'abonner
    <INPUT TYPE="radio" NAME="abonnement" VALUE="se désabonner"> se désabonner
    <INPUT TYPE="submit" VALUE="Submit">
    </FORM>
    another line I would like to add is a size so the box is formatted properly but everytime I do that I mess up things more.
    Thank you for your help
    Mireille

    thank you Kirk,
    You are correct in saying that I do not want to go there. Tough code is not for me
    So how can I have a form where people choose subscribe or unsubscribe then when they submit I get an email?
    Thanks
    Mireille

  • Need help with some simple N900 confusions/problem...

    Hi All
    Just got a UK N900 rx-51_2009se_2.2009.51-1.203.2_pr_203 and I'm rather struggling with some things:
    MMS; didnt get any operator settings for MMS, and can't find any way of creating an MMS. Can someone enlighten me?
    Can this thing not be used in portrait mode other than for the phone dial pad?
    When connecting to e.g. the wireless network they have in the pub, it wants me to push a button on the router, or type a pin into the router - why can't we just have the old fashioned way of "ask the pub staff what the key is, they tell me, and i type it in" - how do I enter the wpa key as a word without this pin/button pushing nonsense?
    How can I type my SMS etc with a 3x3 key pad (like a phone) - I really don't like qwerty on phones.. I'm after a portrait mode, can-be-operated-with-just-a-thumb, 3x3 button layout with predictive text (i.e. like every phone in the history of the world) - how do I do that?
    I can't find any form of Switch app (to copy contacts and messages off my old device) - how do we do this painlessly?
    How do I make the phone forget all the badly spelled words the previous owner seems to have entered?
    Can the thing that organises the main screen snap the icons to a larger grid or must I mess around nudging with the stylus till they line up? (They tend to jump out of line just as I remove the stylus from the screen)
    I'm sure I'll have more questions later..
    Thanks

    Answers to my own Qs for the benefits of others:
    MMS; didnt get any operator settings for MMS, and can't find any way of creating an MMS. Can someone enlighten me?
    No, use fMMS but be aware it's very beta, only allows picture sending with very rudimentary settings and you must change APN manually
    Can this thing not be used in portrait mode other than for the phone dial pad?
    No, apps have to be portrait specific and only dial pad and the browser (experimental) know of it
    When connecting to e.g. the wireless network they have in the pub, it wants me to push a button on the router, or type a pin into the router - why can't we just have the old fashioned way of "ask the pub staff what the key is, they tell me, and i type it in" - how do I enter the wpa key as a word without this pin/button pushing nonsense?
    No - a WONTFIX bug. Configure the connection manually in settings instead and you can type the key
    How can I type my SMS etc with a 3x3 key pad (like a phone) - I really don't like qwerty on phones.. I'm after a portrait mode, can-be-operated-with-just-a-thumb, 3x3 button layout with predictive text (i.e. like every phone in the history of the world) - how do I do that?
    No can do until someone on the maemo team etc creates an on screen keyboard that functions in this way
    I can't find any form of Switch app (to copy contacts and messages off my old device) - how do we do this painlessly?
    No. Transfer and Sync in Settings can retrieve only what Nokia Content Copier can (contacts, calendar, notes) but it's slightly more painless
    How do I make the phone forget all the badly spelled words the previous owner seems to have entered?
    Delete the .xxx.dictionary files from /home/user/.osso/dictionaries dir. May need to be root for this, see sites for info on adding repositories, installing rootsh etc
    Can the thing that organises the main screen snap the icons to a larger grid or must I mess around nudging with the stylus till they line up? (They tend to jump out of line just as I remove the stylus from the screen)

  • I need help with a simple task (PLEASE HELP)

    hi, you know how you can make a button and link it to a
    different site with the actionscript in this program? well I need
    to know of a way like...to make a button and...link it to the next
    frame. ok, heres what im trying to make happen...the user presses a
    button in the flash program thing and a comment apperars. then they
    press it another time and a new one come up...and so on...I could
    make like 50 different frames with new comments on them and then
    make the button on each frame link to the next frame. is there a
    way to do that? if there is I REALLY need your help. please
    thanks :)

    no need to modify anything - look at the first code:
    on (release) {
    nextFrame();
    that's all you need on the button.
    If you want it to happen on click and not release:
    on (press) {
    nextFrame();
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    mybluehair wrote:
    > thank you so much. this will really help me. and, is
    there any way I can modify
    > that script so that its when the mouse is click, and not
    the arrow keys?
    >
    >
    >
    >
    quote:
    Originally posted by:
    Newsgroup User
    > on (release) {
    > nextFrame();
    > }
    >
    > from the help docs (F1):
    >
    > nextFrame function
    > nextFrame() : Void
    >
    > Sends the playhead to the next frame.
    >
    > Availability: ActionScript 1.0; Flash Player 2
    >
    > Example
    > In the following example, when the user presses the
    Right or Down arrow key,
    > the playhead goes to
    > the next frame and stops. If the user presses the Left
    or Up arrow key, the
    > playhead goes to the
    > previous frame and stops. The listener is initialized to
    wait for the arrow
    > key to be pressed, and
    > the init variable is used to prevent the listener from
    being redefined if the
    > playhead returns to
    > Frame 1.
    >
    > stop();
    >
    > if (init == undefined) {
    > someListener = new Object();
    > someListener.onKeyDown = function() {
    > if (Key.isDown(Key.LEFT) || Key.isDown(Key.UP)) {
    > _level0.prevFrame();
    > } else if (Key.isDown(Key.RIGHT) ||
    Key.isDown(Key.DOWN)) {
    > _level0.nextFrame();
    > }
    > };
    > Key.addListener(someListener);
    > init = 1;
    > }
    >
    >
    >
    > ******************************************
    > --> **Adobe Certified Expert**
    > --> www.mudbubble.com
    > --> www.keyframer.com
    >
    >
    >
    >
    > mybluehair wrote:
    > > hi, you know how you can make a button and link it
    to a different site with
    > the
    > > actionscript in this program? well I need to know
    of a way like...to make a
    > > button and...link it to the next frame. ok, heres
    what im trying to make
    > > happen...the user presses a button in the flash
    program thing and a comment
    > > apperars. then they press it another time and a new
    one come up...and so
    > on...I
    > > could make like 50 different frames with new
    comments on them and then make
    > the
    > > button on each frame link to the next frame. is
    there a way to do that? if
    > > there is I REALLY need your help. please
    > >
    > > thanks :)
    > >
    >
    >
    >
    >

  • Need help with this as3 code please

    i got a book called
    actionscript 3.0 adobe flash cs4 pro classroom in a book
    well im on lesson 2 and i followed every step to the letter its supposed to let the user choose a language but when i play the movie the text i want to come up is scrambled for some reason?
    so if some one could help thanks
    i am using cs5 idk if that matters
    http://www.mediafire.com/?memijczzo1y

    In CS5, go to "Text"---->"Font Embedding...". ( Pic.1 )
    Click on "All", ( Pic.2 )
    Then click the "Add" button. ( Pic. 3 ) The font will appear below.
    Then OK
    Pic.1
    Pic. 2
    Pic. 3
    Test your movie.
    Should work now.

  • Need Help With After Effects. Please read.

    Hey,
    So I'm using after effects cs6. The problem I have with it is that the final video after exporting stucks in between and never runs smoothly. I exported my almost 7 minutes video as a quicktime file that is (.mov). SO whenever I play the video in quicktime or any other player, it stucks, sometimes i pause it but it pauses after 10 seconds i click the pause button. sometimes the voice is ahead of sound and vice-versa. It doesnt stuck at the same point everytime. I need my video to run smoothly. Can someone please help.
    Appreciate your reply.
    Thanks

    FAQ: Why is my output file huge, and why doesn't it play back smoothly in a media player?

  • Need help with Audio Midi Setup(please Read)

    Hello,
                I cant find the audio and midi tabs on my toolbar. All I can see is audiomidisetup edit view history bookmarks window help. I need to aggregate a device any ideas or help?

    I think what you are looking for is something like this http://66.34.186.88/LiveCyclesamples/ExpandToFit/TextFieldExpandToFit.pdf
    I am new to this concept, so I cant help out any more. Hope this helps.

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • Help with some beginner code

    Hello, I am new to java and I need a bit of help with some code that I'm writing. here is the code:
    import javax.swing.*;
    public class Test{
         public static void main(String[] args){
         JOptionPane.showMessageDialog(null,"We will now build a block with *'s","Block",1);
         String input=JOptionPane.showInputDialog(null,"Type a number: ","Number",3);
         int number=Integer.parseInt(input);
         int count=0; int count2=0;
         for(count2=0; count2<number; count2++){
              for(count=0; count<number; count++){
              System.out.print("* ");
    System.exit(0);
    }Now, all I need is to build a block of *'s with the number that the user inputs. With the code that I wrote I get the correct number of *'s but not in the form of a block. They just print out in a straight line. I know this is a very simple task but could someone please help me out? What do I need to modify in my code so that the *'s print out arranged as a block like so:
    **********

    Your code only uses the print method which prints without a carriage return/line feed. So you need to add a line of code to print a carriage return/line feed. Where? well that is your task to work out.

  • Need help with a simple process with FTP Adapter and File Adapter

    I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
    I can provide additional info such as the contents of my bpel and wsdl files if needed.
    Would appreciate if someone can help me with this at the earliest.
    Thanks
    Jay

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • Need help with threads?.. please check my approach!!

    Hello frnds,
    I am trying to write a program.. who monitors my external tool.. please check my way of doing it.. as whenever i write programs having thread.. i end up goosy.. :(
    first let me tell.. what I want from program.. I have to start an external tool.. on separate thread.. (as it takes some time).. then it takes some arguments(3 arguments).. from file.. so i read the file.. and have to run tool.. continously.. until there are arguments left.. in file.. or.. user has stopped it by pressing STOP button..
    I have to put a marker in file too.. so that.. if program started again.. file is read from marker postion.. !!
    Hope I make clear.. what am trying to do!!
    My approach is like..
    1. Have two buttons.. START and STOP on Frame..
    START--> pressed
    2. check marker("$" sign.. placed in beginning of file during start).. on file..
         read File from marker.. got 3 arg.. pass it to tool.. and run it.. (on separate thread).. put marker.. (for next reading)
         Step 2.. continously..
    3. STOP--> pressed
         until last thread.. stops.. keep running the tool.. and when last thread stops.. stop reading any more arguments..
    Question is:
    1. Should i read file again and again.. ?.. or read it once after "$" sign.. store data in array.. and once stopped pressed.. read file again.. and put marker ("$" sign) at last read line..
    2. how should i know when my thread has stopped.. so I start tool again??.. am totally confused.. !!
    please modify my approach.. if u find anything odd..
    Thanks a lot in advance
    gervini

    Hello,
    I have no experience with threads or with having more than run "program" in a single java file. All my java files have the same structure. This master.java looks something like this:
    ---master.java---------------------------------------------------
    import java.sql.*;
    import...
    public class Master {
    public static void main(String args []) throws SQLException, IOException {
    //create connection pool here
    while (true) { // start loop here (each loop takes about five minutes)
    // set values of variables
    // select a slave process to run (from a list of slave programs)
    execute selected slave program
    // check for loop exit value
    } // end while loop
    System.out.println("Program Complete");
    } catch (Exception e) {
    System.out.println("Error: " + e);
    } finally {
    if (rSet1 != null)
    try { rSet1.close(); } catch( SQLException ignore ) { /* ignored */ }
    connection.close();
    -------end master.java--------------------------------------------------------
    This master.java program will run continuously for days or weeks, each time through the loop starting another slave process which runs for five minutes to up to an hour, which means there may be ten to twenty of these slave processes running simultaneously.
    I believe threads is the best way to do this, but I don't know where to locate these slave programs: either inside the master.java program or separate slave.java files? I will need help with either method.
    Your help is greatly appreciated. Thank you.
    Logan

  • Need help with flash player installation please !!!!

    Hello,
    I need help with my flash player installation because every time I access a movie this is the message I receive. 
    This content on Xfinity TV is not available for viewing with Chrome's "Incognito" mode. To play this video using Chrome, please view this page without "Incognito" mode.
    Still having problems? Try resetting your Flash player license.

    Incognito mode is a Google Chrome setting when you open a new window (Cmd+Shift+N on a Mac Ctrl+Shift+N on Windows) It opens a "private" window with no cookies and no tracking. The problem with it is that when you disable cookies, your license files are not sent to the site (whetehr it's YouTube or xFinity or any other that uses license files for paid content)  and it treats you as if you're a first time visitor. Paid videos won't play wihtout the cookies sending the license file info.
    This isn't a Flash Player setting. It's in Chrome. I did some research and according to Google, "Incignito" mode is off by default, and can ONLY be activate by the keyboard shortcut. There IS a way to disable it from the registry http://dev.chromium.org/administrators/policy-list-3#IncognitoModeAvailability

  • Need help with a simple program (should be simple anyway)

    I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
    ====================================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Message extends JFrame implements ActionListener {
         public void actionPerformed(ActionEvent evt) {
         text1.setText(" ");
         text2.setText("RE: ");
         text3.setText(" ");
         public Message() {
         super("Write a Message - by Kieran Hannigan");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setSize(370,270);
         FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
         setLayout(flo);
         //Make the bar
         JMenuBar bar = new JMenuBar();
         //Make "File" on Menu
         JMenu File = new JMenu("File");
         JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
         JMenuItem f2 = new JMenuItem("Open");
         JMenuItem f3 = new JMenuItem("Save");
         JMenuItem f4 = new JMenuItem("Save As");
         JMenuItem f5 = new JMenuItem("Exit");
         File.add(f1);
         File.add(f2);
         File.add(f3);
         File.add(f4);
         File.add(f5);
         bar.add(File);
         //Make "Edit" on menu
         JMenu Edit = new JMenu("Edit");
         JMenuItem e1 = new JMenuItem("Cut");
         JMenuItem e2 = new JMenuItem("Paste");
         JMenuItem e3 = new JMenuItem("Copy");
         JMenuItem e4 = new JMenuItem("Repeat");
         JMenuItem e5 = new JMenuItem("Undo");
         Edit.add(e5);
         Edit.add(e4);
         Edit.add(e1);
         Edit.add(e3);
         Edit.add(e2);
         bar.add(Edit);
         //Make "View" on menu
         JMenu View = new JMenu("View");
         JMenuItem v1 = new JMenuItem("Bold");
         JMenuItem v2 = new JMenuItem("Italic");
         JMenuItem v3 = new JMenuItem("Normal");
         JMenuItem v4 = new JMenuItem("Bold-Italic");
         View.add(v1);
         View.add(v2);
         View.add(v3);
         View.addSeparator();
         View.add(v4);
         bar.add(View);
         //Make "Help" on menu
         JMenu Help = new JMenu("Help");
         JMenuItem h1 = new JMenuItem("Help Online");
         JMenuItem h2 = new JMenuItem("E-mail Programmer");
         Help.add(h1);
         Help.add(h2);
         bar.add(Help);
         setJMenuBar(bar);
         //Make Contents of window.
         //Make "Subject" text field
         JPanel row2 = new JPanel();
         JLabel sublabel = new JLabel("Subject:");
         row2.add(sublabel);
         JTextField text2 = new JTextField("RE:",24);
         row2.add(text2);
         //Make "To" text field
         JPanel row1 = new JPanel();
         JLabel tolabel = new JLabel("To:");
         row1.add(tolabel);
         JTextField text1 = new JTextField(24);
         row1.add(text1);
         //Make "Message" text area
         JPanel row3 = new JPanel();
         JLabel Meslabel = new JLabel("Message:");
         row3.add(Meslabel);
         JTextArea text3 = new JTextArea(6,22);
         messagearea.setLineWrap(true);
         messagearea.setWrapStyleWord(true);
         JScrollPane scroll = new JScrollPane(text3,
                                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                  JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         //SpaceLine
         JPanel spaceline = new JPanel();
         JLabel spacer = new JLabel(" ");
         spaceline.add(spacer);
         row3.add(scroll);
         add(row1);
         add(row2);
         add(spaceline);
         add(spaceline);
         add(row3);
         setVisible(true);
         public static void main(String[] arguments) {
         Message Message = new Message();
    }

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • Need help with a simple basketball game.

    Hi im new here and I need help with making this simple basketball game.
    Im trying to recreate this game from this video. Im not sure if he is using as2 or as3
    Or if anyone could help me make a game like this or direct me to a link on how to do it It would be greatly appreciated.

    If you couldn't tell whether it is AS2 or AS3, it is doubtful you can turn it from AS2 into AS3, at least not until you learn both languages.  There is no tool made that does it for you.

Maybe you are looking for