d2jsp
Log InRegister
d2jsp Forums > Diablo II > Diablo 2 Discussion > Player vs. Player Archive > *~* Rev-gfg #1 Hdin *~* > Random S/s's Here!i!
Prev15678932Next
Closed New Topic New Poll
Member
Posts: 1,391
Joined: Dec 23 2004
Gold: 0.30
Warn: 80%
Aug 30 2006 07:07pm
/*
This applet scrolls the message
"Hello World (for absolutely the last time)!"
across the screen over and over.
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ScrollingHelloWorld extends JApplet
implements ActionListener {

Timer timer; // The timer that drives the animation. This
// is created and started in the applet's
// start() method, and is stopped in the
// applet's stop() method.

String message = "Hello World (for absolutely the last time)!";
// The message to be scrolled across the screen.

int messagePosition = -1;
// Current position of the left end of the message, given as the
// distance in pixels from the left edge of the applet.
// In each frame, this is incremented by one character width
// until the message has scrolled completely off the applet.
// Then it is reset to zero. The value of -1 indicates that
// the scrolling has not yet begun.

int messageHeight; // Data about size of message.
int messageWidth;

int charWidth; // The width of one character.

public void init() {
// Make a JPanel to use as the drawing surface of the
// applet, and set its colors and font. The font used
// is a large "Monospaced" font, meaning all the characters
// in the font are the same with. The FontMetric data
// about the message string is also computed here.
JPanel display = new JPanel() {
public void paintComponent(Graphics g) {
// Displays the message string, starting
// messagePosition pixels from the right edge.
super.paintComponent(g);
g.drawString(message, getWidth() - messagePosition,
getHeight()/2 + messageHeight/2);
}
};
setContentPane(display);
display.setBackground(Color.white);
display.setForeground(Color.red);
Font messageFont = new Font("Monospaced", Font.BOLD, 30);
display.setFont(messageFont);
FontMetrics fm = getFontMetrics(messageFont);
messageWidth = fm.stringWidth(message);
messageHeight = fm.getAscent();
charWidth = fm.charWidth('H');
}


public void start() {
// Called when the applet is being started or restarted.
// Create a new timer, or restart the existing timer.
if (timer == null) {
timer = new Timer(300, this);
timer.start();
}
else {
timer.restart();
}
}


public void stop() {
// Called when the applet is about to be stopped.
// Stop the timer.
timer.stop();
}


public void actionPerformed(ActionEvent evt) {
// Compute and display the next frame of the animation.
// This is called in response to events from the timer.
// Move the message position one character to the left.
// If the message has moved entirely off the applet,
// put it back in its starting position.
messagePosition += charWidth;
if (getSize().width - messagePosition + messageWidth < 0) {
// message has moved off left edge
messagePosition = 0;
}
repaint();
}


} // end class ScrollingHelloWorld
Member
Posts: 71
Joined: Aug 30 2006
Gold: Locked
Trader: Scammer
Warn: 10%
Aug 30 2006 07:08pm
Jooooooooooooooo
Blooooooooooooooooooooooooooooow
Moooooooooooooooooooooooooooooooooooooch
Member
Posts: 14,362
Joined: Jan 18 2006
Gold: 6,324.00
Aug 30 2006 07:08pm
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:07am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:07am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:05am)
rand


didnt you screw over your family member?


yes. you are next. i stop at nothing


game < family .. get a life nerd.. you stole your brother .. lol .. what a fucking loser
Member
Posts: 19,938
Joined: May 25 2006
Gold: 25,252.23
Aug 30 2006 07:09pm
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:08am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:07am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:07am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:05am)
rand


didnt you screw over your family member?


yes. you are next. i stop at nothing


game < family .. get a life nerd.. you stole your brother .. lol .. what a fucking loser


he stole me dipshit. so i raped him with wellfaredin to show him what was up
Member
Posts: 14,362
Joined: Jan 18 2006
Gold: 6,324.00
Aug 30 2006 07:09pm
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:09am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:08am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:07am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:07am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:05am)
rand


didnt you screw over your family member?


yes. you are next. i stop at nothing


game < family .. get a life nerd.. you stole your brother .. lol .. what a fucking loser


he stole me dipshit. so i raped him with wellfaredin to show him what was up


game < family nerd
Member
Posts: 9,288
Joined: Sep 26 2005
Gold: 0.01
Aug 30 2006 07:10pm
Quote (t.r.a.v. @ Wed, Aug 30 2006, 09:07pm)
/*
  This applet scrolls the message
      "Hello World (for absolutely the last time)!"
  across the screen over and over.
*/

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ScrollingHelloWorld extends JApplet
                          implements ActionListener {

  Timer timer;  // The timer that drives the animation.  This
                // is created and started in the applet's
                // start() method, and is stopped in the
                // applet's stop() method.
                                     
  String message = "Hello World (for absolutely the last time)!"; 
          // The message to be scrolled across the screen.
 
  int messagePosition = -1; 
          // Current position of the left end of the message, given as the
          //  distance in pixels from the left edge of the applet.
          //  In each frame, this is incremented by one character width
          //  until the message has scrolled completely off the applet.
          //  Then it is reset to zero.  The value of -1 indicates that
          //  the scrolling has not yet begun.
 
  int messageHeight;  // Data about size of message.
  int messageWidth;
 
  int charWidth;  // The width of one character.

  public void init() {
        // Make a JPanel to use as the drawing surface of the
        // applet, and set its colors and font.  The font used
        // is a large "Monospaced" font, meaning all the characters
        // in the font are the same with.  The FontMetric data
        // about the message string is also computed here.
      JPanel display = new JPanel() {
            public void paintComponent(Graphics g) {
                // Displays the message string, starting
                // messagePosition pixels from the right edge.
              super.paintComponent(g);
              g.drawString(message, getWidth() - messagePosition,
                                    getHeight()/2 + messageHeight/2);
            }
        };
      setContentPane(display);
      display.setBackground(Color.white);
      display.setForeground(Color.red);
      Font messageFont = new Font("Monospaced", Font.BOLD, 30);
      display.setFont(messageFont);
      FontMetrics fm = getFontMetrics(messageFont);
      messageWidth = fm.stringWidth(message);
      messageHeight = fm.getAscent();
      charWidth = fm.charWidth('H');
  }
 

  public void start() {
        // Called when the applet is being started or restarted.
        // Create a new timer, or restart the existing timer.
      if (timer == null) {
        timer = new Timer(300, this);
        timer.start();
      }
      else {
        timer.restart();
      }
  }
 

  public void stop() {
        // Called when the applet is about to be stopped.
        // Stop the timer.
      timer.stop();
  }
 
 
  public void actionPerformed(ActionEvent evt) {
          // Compute and display the next frame of the animation. 
          // This is called in response to events from the timer.
          // Move the message position one character to the left.
          // If the message has moved entirely off the applet,
          // put it back in its starting position.
      messagePosition += charWidth;
      if (getSize().width - messagePosition + messageWidth < 0) {
            // message has moved off left edge
          messagePosition = 0;
      }
      repaint();
  }     
           
 
} // end class ScrollingHelloWorld




BLUEJ JAVA LOL!
Member
Posts: 19,938
Joined: May 25 2006
Gold: 25,252.23
Aug 30 2006 07:10pm
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:09am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:09am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:08am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:07am)
Quote (chunkaduceb4ugo @ Thu, Aug 31 2006, 01:07am)
Quote (FoRSaKeN- @ Thu, Aug 31 2006, 01:05am)
rand


didnt you screw over your family member?


yes. you are next. i stop at nothing


game < family .. get a life nerd.. you stole your brother .. lol .. what a fucking loser


he stole me dipshit. so i raped him with wellfaredin to show him what was up


game < family nerd


nty, read www.myspace.com/despondencydano
Member
Posts: 39,484
Joined: Jul 5 2005
Gold: 0.00
Aug 30 2006 07:11pm
9 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
9 Members: Mr Hippie, Cidco, FoRSaKeN-, Whyteboi, BHL-chris, NuGGeTKinG, penguinpoker, RichieLictawa, CrackBoo

give coa newb
Member
Posts: 19,938
Joined: May 25 2006
Gold: 25,252.23
Aug 30 2006 07:12pm
Quote (Mr Hippie @ Thu, Aug 31 2006, 01:11am)
9 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
9 Members: Mr Hippie, Cidco, FoRSaKeN-, Whyteboi, BHL-chris, NuGGeTKinG, penguinpoker, RichieLictawa, CrackBoo

give coa newb


9 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
9 Members: FoRSaKeN-, Cidco, BHL-chris, sintonyx, chunkaduceb4ugo, NuGGeTKinG, penguinpoker, RichieLictawa, CrackBoo

I have char name BHL-Leader FT no joke
fo real

This post was edited by FoRSaKeN- on Aug 30 2006 07:12pm
Member
Posts: 11,566
Joined: Apr 19 2006
Gold: 861.91
Aug 30 2006 07:13pm
what a joke.
Go Back To Player vs. Player Archive Topic List
Prev15678932Next
Closed New Topic New Poll