code stuff

public class Move{

ImageIcon cup = new ImageIcon("C:\\Documents and Settings\\Michael Leaf\\My Documents\\My Pictures\\acer.jpg");

JLabel label = new JLabel(cup);

public Move() {

JFrame frame = new JFrame();

frame.setSize(600, 600);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel cp = (JPanel)frame.getContentPane();

cp.setLayout(null);

cp.setBackground(Color.white);

label.setSize(250,100);

label.setLocation(100,100);

cp.add(label);

frame.setVisible(true);

}

public static void main(String[] args) {

Move myMove = new Move();

int x, y;

//repeat forever

while(true) {

for(x = 0; x < 400; x++) {

myMove.label.setLocation(0,x );

pause(5);

}

for(x = 400; x > 0; x--) {

myMove.label.setLocation(x, x);

pause(5);

}

}

}

static void pause(long time) {

try {

Thread.sleep(time);

}

catch(InterruptedException e) {

throw new RuntimeException("dont care.");

}

}

}

[1149 byte] By [michael_leaf15a] at [2007-11-27 6:16:45]
# 1
who understands that?
michael_leaf15a at 2007-7-12 17:28:46 > top of Java-index,Java Essentials,Java Programming...
# 2
I see poorly formated code (use code tags!) and no question.So, no answer.
petes1234a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 3
> who understands that?repost your code formated, please.
petes1234a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 4

public class Move{

ImageIcon cup = new ImageIcon("C:\\Documents and Settings\\Michael Leaf\\My Documents\\My Pictures\\acer.jpg");

JLabel label = new JLabel(cup);

public Move() {

JFrame frame = new JFrame();

frame.setSize(600, 600);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel cp = (JPanel)frame.getContentPane();

cp.setLayout(null);

cp.setBackground(Color.white);

label.setSize(250,100);

label.setLocation(100,100);

cp.add(label);

frame.setVisible(true);

}

public static void main(String[] args) {

Move myMove = new Move();

int x, y;

//repeat forever

while(true) {

for(x = 0; x < 400; x++) {

myMove.label.setLocation(0,x );

pause(5);

}

for(x = 400; x > 0; x--) {

myMove.label.setLocation(x, x);

pause(5);

}

}

}

static void pause(long time) {

try {

Thread.sleep(time);

}

catch(InterruptedException e) {

throw new RuntimeException("dont care.");

}

}

}

michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 5
how?
michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 6

do you know about code tags? you surround your code with [ code ] and [ /code ] (without the spaces). It then makes the code readable.

Also, why not give us your interpretation first and then any specific questions you might have. The question above is not really specific enough. I could say, "I do" which is a perfectly valid answer, but probably not the one you want to hear.

petes1234a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 7

public class Move{

ImageIcon cup = new ImageIcon("C:\\Documents and Settings\\Michael Leaf\\My Documents\\My Pictures\\acer.jpg");

JLabel label = new JLabel(cup);

public Move() {

JFrame frame = new JFrame();

frame.setSize(600, 600);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel cp = (JPanel)frame.getContentPane();

cp.setLayout(null);

cp.setBackground(Color.white);

label.setSize(250,100);

label.setLocation(100,100);

cp.add(label);

frame.setVisible(true);

}

public static void main(String[] args) {

Move myMove = new Move();

int x, y;

//repeat forever

while(true) {

for(x = 0; x < 400; x++) {

myMove.label.setLocation(0,x );

pause(5);

}

for(x = 400; x > 0; x--) {

myMove.label.setLocation(x, x);

pause(5);

}

}

}

static void pause(long time) {

try {

Thread.sleep(time);

}

catch(InterruptedException e) {

throw new RuntimeException("dont care.");

}

}

}

michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 8
doesnt work
michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 9
all right.When you click "reply" - just above the text box where you'd type your reply, there is a "code" button. Click it. Then you will see to tags, one says [ code ] the other says [ /code ]. Insert your code between the [ code ] tag and the [ /code ] tag.
Navy_Codera at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 10

public class Move{

ImageIcon cup = new ImageIcon("C:\\Documents and Settings\\Michael Leaf\\My Documents\\My Pictures\\acer.jpg");

JLabel label = new JLabel(cup);

public Move() {

JFrame frame = new JFrame();

frame.setSize(600, 600);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel cp = (JPanel)frame.getContentPane();

cp.setLayout(null);

cp.setBackground(Color.white);

label.setSize(250,100);

label.setLocation(100,100);

cp.add(label);

frame.setVisible(true);

}

public static void main(String[] args) {

Move myMove = new Move();

int x, y;

//repeat forever

while(true) {

for(x = 0; x < 400; x++) {

myMove.label.setLocation(0,x );

pause(5);

}

for(x = 400; x > 0; x--) {

myMove.label.setLocation(x, x);

pause(5);

}

}

}

static void pause(long time) {

try {

Thread.sleep(time);

}

catch(InterruptedException e) {

throw new RuntimeException("dont care.");

}

}

}

michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 11
so thats how ppl do it
michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 12
> so thats how ppl do itNo, usually they just type in the code tags manually.... at least I do.
Navy_Codera at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 13
Muuuuuch better...Now, what part about this prog don't you understand?
petes1234a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 14
well my friend made it for me and it works i can change stuff but i dont understand how to control it
michael_leaf15a at 2007-7-12 17:28:47 > top of Java-index,Java Essentials,Java Programming...
# 15
> well my friend made it for me and it works i can> change stuff but i dont understand how to control it"Control it"? Could you give an example of what you mean?
Hippolytea at 2007-7-21 21:49:15 > top of Java-index,Java Essentials,Java Programming...