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
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.
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
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.
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.
Take a look at the tutorial:
Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
If you don't understand my answer, don't ignore it, ask a question.
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
A public class must be in a file with a name the same as the class name.should be declared in a file named Bus.java
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.