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 6 of 6

Thread: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    I have a homework assignment dealing with graphics.
    I need a little bit of feedback on how to get started!
    D:
    If someone could please help explain a little, I would appreciate it.bus.jpg
    i attached the graphic i am supposed to make


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    Please ask as specific a question as possible. Right now it's hard to know what you need to do, or more importantly exactly where your stuck. Also show what you've tried and explain how it's not working.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    I'm not even sure how to go about doing a graphic... I tried to follow my professors examples, but I cannot get anything to work.
    He gave us an example of a rectangle :/ and i cannot even get it to compile correctly.

    --- Update ---

    For my assignment, this picture is all he gave us.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    I will take a look at this, thank you!

    --- Update ---

    I try to follow the tutorial.
    package painting;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;

    public class Bus {
    public static void main(String[]args){
    SwingUtilities.invokeLater(new Runnable(){
    public void run(){
    createAndShowGUI();
    }
    });
    }
    private static void createAndShowGUI(){
    System.out.println("Create GUI on EDT"+
    SwingUtilities.isEventDispatchThread());
    JFrame f=new JFrame("Swing Paint Demo");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(250,250);
    f.setVisible(true);
    }
    }
    i typed this in notepad...
    but i get the compiler error of
    C:\Users\aml46720\Documents\bus.java:5: class Bus is public, should be declared in a file named Bus.java
    public class Bus {
    ^
    1 error

    Tool completed with exit code 1

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Actually, i just started learning java... and i am having alot of trouble understanding the concept.

    should be declared in a file named Bus.java
    A public class must be in a file with a name the same as the class name.

    Please edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Having trouble understanding recursive methods??
    By orbin in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 17th, 2012, 01:08 AM
  2. Having trouble getting started testing for matching delimiter sets.
    By orbin in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 5th, 2012, 01:48 PM
  3. Having trouble understanding Int Logs.
    By orbin in forum What's Wrong With My Code?
    Replies: 10
    Last Post: October 10th, 2012, 12:30 PM
  4. Inheritance trouble understanding how to use it?
    By orbin in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 21st, 2012, 11:24 AM
  5. Replies: 2
    Last Post: July 5th, 2012, 07:46 PM