Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

DÉFILEMENT HORIZONTAL D'UN TEXTE DANS UNE APPLET [NOUVEAU!! APPLET 100% CONFIGURABLE]


Information sur la source

Catégorie :Applet Classé sous : applet, défilement, horizontal, scroll, scrolling Niveau : Débutant Date de création : 09/03/2002 Date de mise à jour : 05/08/2007 16:15:53 Vu / téléchargé: 10 930 / 557

Note :
10 / 10 - par 1 personne
10,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

Description

Cliquez pour voir la capture en taille normale
Le code fait défiler un texte dans une Applet Java. Le code a été testé sous java 5.0.
L'applet permet de changer facilement les paramètres à travers une page HTML, il est possible de changer les couleurs, la police, le sens de défilement ainsi que la vitesse.


 

Source

  • /**
  • * @author bouba331
  • */
  • import java.awt.Color;
  • import java.awt.Font;
  • import java.awt.Graphics;
  • import java.awt.Graphics2D;
  • import java.awt.GraphicsEnvironment;
  • import java.awt.font.TextLayout;
  • import javax.swing.JApplet;
  • /**
  • * An applet class used to display a scrolling message
  • */
  • public class AppletDefil extends JApplet implements Runnable {
  • /**
  • * The serial version UID used for deserialization
  • */
  • private static final long serialVersionUID = 2780848656726242957L;
  • /**
  • * The animation speed in milliseconds.
  • */
  • private int animationSpeed = 20;
  • /**
  • * Thread used to animate the applet (make pauses)
  • */
  • private Thread animationThread;
  • /**
  • * Object used to describe the applet background color
  • */
  • private Color appletBackgroundColor;
  • /**
  • * Blue value for the applet background color
  • */
  • private int appletBackgroundColorBlue = 0;
  • /**
  • * Green value for the applet background color
  • */
  • private int appletBackgroundColorGreen = 0;
  • /**
  • * Blue value for the applet background color
  • */
  • private int appletBackgroundColorRed = 0;
  • /**
  • * Font object for our message
  • */
  • private Font messagefont;
  • /**
  • * The name of the font used to display the message
  • */
  • private String messagefontName = "Times";
  • /**
  • * The size of the font used to display the message
  • */
  • private int messageFontSize = 12;
  • /**
  • * The style of the font used to display the message
  • */
  • private int messageFontStyle = Font.PLAIN;
  • /**
  • * The message to display
  • */
  • private String message = "Message";
  • /**
  • * Object used to describe the color of the message
  • */
  • private Color messageColor;
  • /**
  • * Blue value for the color of the message
  • */
  • private int messageColorBlue = 255;
  • /**
  • * Green value for color of the message
  • */
  • private int messageColorGreen = 255;
  • /**
  • * Red value for the color of the message
  • */
  • private int messageColorRed = 255;
  • /**
  • * The scroll direction, positive value indicate left to right, negative
  • * value right to left
  • */
  • private int scrollDirection;
  • /**
  • * Object used to describe the scroll zone background color
  • */
  • private Color scrollZoneBackgroundColor;
  • /**
  • * Blue value for the scroll zone background color
  • */
  • private int scrollZoneBackgroundColorBlue = 0;
  • /**
  • * Green value for the scroll zone background color
  • */
  • private int scrollZoneBackgroundColorGreen = 0;
  • /**
  • * Red value for the scroll zone background color
  • */
  • private int scrollZoneBackgroundColorRed = 0;
  • /**
  • * X bottom right corner coordinate of the scroll zone
  • */
  • private int scrollZoneBottomRightCornerX = 390;
  • /**
  • * Y bottom right corner coordinate of the scroll zone
  • */
  • private int scrollZoneBottomRightCornerY = 50;
  • /**
  • * X top left corner coordinate of the scroll zone
  • */
  • private final int scrollZoneTopLeftCornerX = 10;
  • /**
  • * Y top left corner coordinate of the scroll zone
  • */
  • private final int scrollZoneTopLeftCornerY = 10;
  • /**
  • * The height of our message in pixels, will be computed in the init()
  • * function.
  • */
  • private int textHeight;
  • /**
  • * The width of our message in pixels, will be computed in the init()
  • * function.
  • */
  • private int textWidth;
  • /**
  • * An x position updated to animate the message.
  • */
  • private int x;
  • /**
  • * @see java.applet.Applet#destroy()
  • */
  • @Override
  • public void destroy() {
  • // Free the animation Thread
  • animationThread = null;
  • }
  • /**
  • * @see java.applet.Applet#init()
  • */
  • @Override
  • public void init() {
  • getAppletParameters();
  • // initialize the scroll zone background color
  • scrollZoneBackgroundColor = new Color(scrollZoneBackgroundColorRed,
  • scrollZoneBackgroundColorGreen, scrollZoneBackgroundColorBlue);
  • // initialize the applet background color
  • appletBackgroundColor = new Color(appletBackgroundColorRed,
  • appletBackgroundColorGreen, appletBackgroundColorBlue);
  • // initialize the foreground color (text color) of the applet
  • messageColor = new Color(messageColorRed, messageColorGreen,
  • messageColorBlue);
  • // Initialize the font
  • messagefont = new Font(messagefontName, messageFontStyle,
  • messageFontSize);
  • // Compute the width of the message
  • Graphics2D g = (Graphics2D) this.getGraphics();
  • TextLayout tl = new TextLayout(message, messagefont, g
  • .getFontRenderContext());
  • textWidth = (int) tl.getBounds().getWidth();
  • textHeight = (int) tl.getBounds().getHeight();
  • }
  • /**
  • * @see java.awt.Container#paint(java.awt.Graphics)
  • */
  • @Override
  • public void paint(Graphics graphics) {
  • Graphics2D g = (Graphics2D) graphics;
  • // Sets the background color and feels the rectangle
  • g.setColor(scrollZoneBackgroundColor);
  • g.fillRect(scrollZoneTopLeftCornerX, scrollZoneTopLeftCornerY,
  • scrollZoneBottomRightCornerX, scrollZoneBottomRightCornerY);
  • // Sets the text properties, color and font.
  • g.setColor(messageColor);
  • g.setFont(messagefont);
  • // Draw our message
  • g.drawString(message, x, scrollZoneTopLeftCornerY + textHeight);
  • // Fill the borders
  • g.setColor(appletBackgroundColor);
  • g.fillRect(0, 0, this.getWidth(), scrollZoneTopLeftCornerY);
  • g.fillRect(0, scrollZoneBottomRightCornerY, this.getWidth(), this
  • .getHeight());
  • g.fillRect(0, 0, scrollZoneTopLeftCornerX, this.getHeight());
  • g.fillRect(scrollZoneBottomRightCornerX, 0, this.getWidth(), this
  • .getHeight());
  • }
  • /**
  • * @see java.lang.Runnable#run()
  • */
  • public void run() {
  • while (animationThread != null)
  • updatePosition();
  • }
  • /**
  • * @see java.applet.Applet#start()
  • */
  • @Override
  • public void start() {
  • // Initialize and start our annimation thread
  • if (animationThread == null)
  • animationThread = new Thread(this);
  • animationThread.start();
  • }
  • /**
  • * @see java.applet.Applet#stop()
  • */
  • @Override
  • public void stop() {
  • // Stop the animation Thread
  • animationThread = null;
  • }
  • /**
  • * Get an integer parameter from the applet parameters
  • *
  • * @param parameterName
  • * The name of the parameter to retrieve
  • * @param parameter
  • * The value of the default parameter
  • * @return The value of the parameter retrieved from the <param> tag or the
  • * default parameter value if no <param name=parameterName/> has
  • * been specified in the <applet> tag.
  • */
  • private int getAppletParameterInt(String parameterName, int parameter) {
  • int appletParameterInt;
  • String appletParameterString = getParameter(parameterName);
  • try {
  • appletParameterInt = Integer.parseInt(appletParameterString);
  • } catch (NumberFormatException e) {
  • return parameter;
  • }
  • return appletParameterInt;
  • }
  • /**
  • * Retrieve the applet parameters
  • */
  • private void getAppletParameters() {
  • // Retrieve the message
  • if (getParameter("message") != null)
  • message = getParameter("message");
  • // Retrieve the animation speed
  • animationSpeed = getAppletParameterInt("animation_speed",
  • animationSpeed);
  • // Retrieve the scroll direction
  • scrollDirection = Integer.parseInt(getParameter("scroll_direction"));
  • // Retrieve the scroll zone background colors
  • scrollZoneBackgroundColorRed = getAppletParameterInt(
  • "scroll_zone_background_color_red",
  • scrollZoneBackgroundColorRed);
  • scrollZoneBackgroundColorGreen = getAppletParameterInt(
  • "scroll_zone_background_color_green",
  • scrollZoneBackgroundColorGreen);
  • scrollZoneBackgroundColorBlue = getAppletParameterInt(
  • "scroll_zone_background_color_blue",
  • scrollZoneBackgroundColorBlue);
  • // Retrieve the applet background colors
  • appletBackgroundColorRed = getAppletParameterInt(
  • "applet_background_color_red", appletBackgroundColorRed);
  • appletBackgroundColorGreen = getAppletParameterInt(
  • "applet_background_color_green", appletBackgroundColorGreen);
  • appletBackgroundColorBlue = getAppletParameterInt(
  • "applet_background_color_blue", appletBackgroundColorBlue);
  • // Retrieve the text message colors
  • messageColorRed = getAppletParameterInt("message_color_red",
  • messageColorRed);
  • messageColorGreen = getAppletParameterInt("message_color_green",
  • messageColorGreen);
  • messageColorBlue = getAppletParameterInt("message_color_blue",
  • messageColorBlue);
  • // Retrieve font properties
  • if (getParameter("message_font_name") != null)
  • messagefontName = getParameter("message_font_name");
  • String fontStyleString = getParameter("message_font_style");
  • if (fontStyleString != null)
  • if (fontStyleString.equals("BOLD"))
  • messageFontStyle = Font.BOLD;
  • else
  • if (fontStyleString.equals("ITALIC"))
  • messageFontStyle = Font.ITALIC;
  • else
  • if (fontStyleString.equals("PLAIN"))
  • messageFontStyle = Font.PLAIN;
  • else
  • if (fontStyleString.equals("BOLD_ITALIC"))
  • messageFontStyle = Font.BOLD | Font.ITALIC;
  • messageFontSize = getAppletParameterInt("message_font_size",
  • messageFontSize);
  • }
  • /**
  • * Retrieve informations about applet parameters.
  • *
  • * @see java.applet.Applet#getParameterInfo()
  • */
  • public String[][] getParameterInfo() {
  • String[][] info = {
  • // Parameter Name Kind of Value Description
  • { "animation_speed", "int",
  • "Speed of the animation (pause between applet updates) in milliseconds" },
  • { "applet_background_color_blue", "int",
  • "Blue value for the applet background color" },
  • { "applet_background_color_green", "int",
  • "Green value for the applet background color" },
  • { "applet_background_color_red", "int",
  • "Red value for the applet background color" },
  • { "message_font_name", "String",
  • "Font name for the message to display" },
  • { "message_font_size", "int",
  • "Font size for the message to display" },
  • { "message_font_type", "String", "Font type for the message to display" },
  • { "message", "String", "The message to display" },
  • { "message_color_blue", "int",
  • "Blue value for the message text color" },
  • { "message_color_green", "int",
  • "Green value for the message texte color" },
  • { "message_color_red", "int",
  • "Red value for the message text color" },
  • {
  • "scroll_direction",
  • "int",
  • "Direction of the scrolling, a positive"
  • + " value indicate left to right scrolling,"
  • + " negative value right from left" },
  • { "scroll_zone_background_color_blue", "int",
  • "Blue value for the scroll zone backrgound color" },
  • { "scroll_zone_background_color_green", "int",
  • "Green value for the scroll zone background color" },
  • { "scroll_zone_background_color_red", "int",
  • "Red value for the scroll zone backrgound color" }, };
  • return info;
  • }
  • /**
  • * Wait for 'animationSpeed' milliseconds and redraw the scene.
  • */
  • private void pauseAnimation() {
  • try {
  • Thread.sleep(animationSpeed);
  • repaint();
  • } catch (InterruptedException ie) {
  • }
  • }
  • /**
  • * Update the position of our message and redraw the the scene.
  • */
  • private void updatePosition() {
  • if (scrollDirection >= 0)
  • for (x = (scrollZoneTopLeftCornerX - textWidth); x < scrollZoneBottomRightCornerX; x++)
  • pauseAnimation();
  • else
  • for (x = scrollZoneBottomRightCornerX; x > (scrollZoneTopLeftCornerX - textWidth); x--)
  • pauseAnimation();
  • }
  • }
/**
 * @author bouba331
 */

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.font.TextLayout;

import javax.swing.JApplet;


/**
 * An applet class used to display a scrolling message
 */
public class AppletDefil extends JApplet implements Runnable {

	/**
	 * The serial version UID used for deserialization
	 */
	private static final long serialVersionUID = 2780848656726242957L;

	/**
	 * The animation speed in milliseconds.
	 */
	private int animationSpeed = 20;

	/**
	 * Thread used to animate the applet (make pauses)
	 */
	private Thread animationThread;

	/**
	 * Object used to describe the applet background color
	 */
	private Color appletBackgroundColor;

	/**
	 * Blue value for the applet background color
	 */
	private int appletBackgroundColorBlue = 0;

	/**
	 * Green value for the applet background color
	 */
	private int appletBackgroundColorGreen = 0;

	/**
	 * Blue value for the applet background color
	 */
	private int appletBackgroundColorRed = 0;

	/**
	 * Font object for our message
	 */
	private Font messagefont;

	/**
	 * The name of the font used to display the message
	 */
	private String messagefontName = "Times";

	/**
	 * The size of the font used to display the message
	 */
	private int messageFontSize = 12;

	/**
	 * The style of the font used to display the message
	 */
	private int messageFontStyle = Font.PLAIN;

	/**
	 * The message to display
	 */
	private String message = "Message";

	/**
	 * Object used to describe the color of the message
	 */
	private Color messageColor;

	/**
	 * Blue value for the color of the message
	 */
	private int messageColorBlue = 255;

	/**
	 * Green value for color of the message
	 */
	private int messageColorGreen = 255;

	/**
	 * Red value for the color of the message
	 */
	private int messageColorRed = 255;

	/**
	 * The scroll direction, positive value indicate left to right, negative
	 * value right to left
	 */
	private int scrollDirection;

	/**
	 * Object used to describe the scroll zone background color
	 */
	private Color scrollZoneBackgroundColor;

	/**
	 * Blue value for the scroll zone background color
	 */
	private int scrollZoneBackgroundColorBlue = 0;

	/**
	 * Green value for the scroll zone background color
	 */
	private int scrollZoneBackgroundColorGreen = 0;

	/**
	 * Red value for the scroll zone background color
	 */
	private int scrollZoneBackgroundColorRed = 0;

	/**
	 * X bottom right corner coordinate of the scroll zone
	 */
	private int scrollZoneBottomRightCornerX = 390;

	/**
	 * Y bottom right corner coordinate of the scroll zone
	 */
	private int scrollZoneBottomRightCornerY = 50;

	/**
	 * X top left corner coordinate of the scroll zone
	 */
	private final int scrollZoneTopLeftCornerX = 10;

	/**
	 * Y top left corner coordinate of the scroll zone
	 */
	private final int scrollZoneTopLeftCornerY = 10;

	/**
	 * The height of our message in pixels, will be computed in the init()
	 * function.
	 */
	private int textHeight;

	/**
	 * The width of our message in pixels, will be computed in the init()
	 * function.
	 */
	private int textWidth;

	/**
	 * An x position updated to animate the message.
	 */
	private int x;

	/**
	 * @see java.applet.Applet#destroy()
	 */
	@Override
	public void destroy() {

		// Free the animation Thread
		animationThread = null;

	}

	/**
	 * @see java.applet.Applet#init()
	 */
	@Override
	public void init() {

		getAppletParameters();

		// initialize the scroll zone background color
		scrollZoneBackgroundColor = new Color(scrollZoneBackgroundColorRed,
				scrollZoneBackgroundColorGreen, scrollZoneBackgroundColorBlue);

		// initialize the applet background color
		appletBackgroundColor = new Color(appletBackgroundColorRed,
				appletBackgroundColorGreen, appletBackgroundColorBlue);

		// initialize the foreground color (text color) of the applet
		messageColor = new Color(messageColorRed, messageColorGreen,
				messageColorBlue);

		// Initialize the font
		messagefont = new Font(messagefontName, messageFontStyle,
				messageFontSize);

		// Compute the width of the message
		Graphics2D g = (Graphics2D) this.getGraphics();
		TextLayout tl = new TextLayout(message, messagefont, g
				.getFontRenderContext());
		textWidth = (int) tl.getBounds().getWidth();
		textHeight = (int) tl.getBounds().getHeight();

	}

	/**
	 * @see java.awt.Container#paint(java.awt.Graphics)
	 */
	@Override
	public void paint(Graphics graphics) {
		Graphics2D g = (Graphics2D) graphics;

		// Sets the background color and feels the rectangle
		g.setColor(scrollZoneBackgroundColor);
		g.fillRect(scrollZoneTopLeftCornerX, scrollZoneTopLeftCornerY,
				scrollZoneBottomRightCornerX, scrollZoneBottomRightCornerY);

		// Sets the text properties, color and font.
		g.setColor(messageColor);
		g.setFont(messagefont);

		// Draw our message
		g.drawString(message, x, scrollZoneTopLeftCornerY + textHeight);

		// Fill the borders
		g.setColor(appletBackgroundColor);
		g.fillRect(0, 0, this.getWidth(), scrollZoneTopLeftCornerY);
		g.fillRect(0, scrollZoneBottomRightCornerY, this.getWidth(), this
				.getHeight());
		g.fillRect(0, 0, scrollZoneTopLeftCornerX, this.getHeight());
		g.fillRect(scrollZoneBottomRightCornerX, 0, this.getWidth(), this
				.getHeight());
	}

	/**
	 * @see java.lang.Runnable#run()
	 */
	public void run() {

		while (animationThread != null)
			updatePosition();

	}

	/**
	 * @see java.applet.Applet#start()
	 */
	@Override
	public void start() {

		// Initialize and start our annimation thread
		if (animationThread == null)
			animationThread = new Thread(this);

		animationThread.start();

	}

	/**
	 * @see java.applet.Applet#stop()
	 */
	@Override
	public void stop() {

		// Stop the animation Thread
		animationThread = null;

	}

	/**
	 * Get an integer parameter from the applet parameters
	 * 
	 * @param parameterName
	 *            The name of the parameter to retrieve
	 * @param parameter
	 *            The value of the default parameter
	 * @return The value of the parameter retrieved from the <param> tag or the
	 *         default parameter value if no <param name=parameterName/> has
	 *         been specified in the <applet> tag.
	 */
	private int getAppletParameterInt(String parameterName, int parameter) {

		int appletParameterInt;
		String appletParameterString = getParameter(parameterName);

		try {
			appletParameterInt = Integer.parseInt(appletParameterString);
		} catch (NumberFormatException e) {
			return parameter;
		}

		return appletParameterInt;
	}

	/**
	 * Retrieve the applet parameters
	 */
	private void getAppletParameters() {
		// Retrieve the message
		if (getParameter("message") != null)
			message = getParameter("message");

		// Retrieve the animation speed
		animationSpeed = getAppletParameterInt("animation_speed",
				animationSpeed);

		// Retrieve the scroll direction
		scrollDirection = Integer.parseInt(getParameter("scroll_direction"));

		// Retrieve the scroll zone background colors
		scrollZoneBackgroundColorRed = getAppletParameterInt(
				"scroll_zone_background_color_red",
				scrollZoneBackgroundColorRed);
		scrollZoneBackgroundColorGreen = getAppletParameterInt(
				"scroll_zone_background_color_green",
				scrollZoneBackgroundColorGreen);
		scrollZoneBackgroundColorBlue = getAppletParameterInt(
				"scroll_zone_background_color_blue",
				scrollZoneBackgroundColorBlue);

		// Retrieve the applet background colors
		appletBackgroundColorRed = getAppletParameterInt(
				"applet_background_color_red", appletBackgroundColorRed);
		appletBackgroundColorGreen = getAppletParameterInt(
				"applet_background_color_green", appletBackgroundColorGreen);
		appletBackgroundColorBlue = getAppletParameterInt(
				"applet_background_color_blue", appletBackgroundColorBlue);

		// Retrieve the text message colors
		messageColorRed = getAppletParameterInt("message_color_red",
				messageColorRed);
		messageColorGreen = getAppletParameterInt("message_color_green",
				messageColorGreen);
		messageColorBlue = getAppletParameterInt("message_color_blue",
				messageColorBlue);

		// Retrieve font properties
		if (getParameter("message_font_name") != null)
			messagefontName = getParameter("message_font_name");

		String fontStyleString = getParameter("message_font_style");
		if (fontStyleString != null)
			if (fontStyleString.equals("BOLD"))
				messageFontStyle = Font.BOLD;
			else
				if (fontStyleString.equals("ITALIC"))
					messageFontStyle = Font.ITALIC;
				else
					if (fontStyleString.equals("PLAIN"))
						messageFontStyle = Font.PLAIN;
					else
						if (fontStyleString.equals("BOLD_ITALIC"))
							messageFontStyle = Font.BOLD | Font.ITALIC;

		messageFontSize = getAppletParameterInt("message_font_size",
				messageFontSize);
	}

	/**
	 * Retrieve informations about applet parameters.
	 * 
	 * @see java.applet.Applet#getParameterInfo()
	 */
	public String[][] getParameterInfo() {
		String[][] info = {
				// Parameter Name Kind of Value Description
				{ "animation_speed", "int",
						"Speed of the animation (pause between applet updates) in milliseconds" },
				{ "applet_background_color_blue", "int",
						"Blue value for the applet background color" },
				{ "applet_background_color_green", "int",
						"Green value for the applet background color" },
				{ "applet_background_color_red", "int",
						"Red value for the applet background color" },
				{ "message_font_name", "String",
						"Font name for the message to display" },
				{ "message_font_size", "int",
						"Font size for the message to display" },
				{ "message_font_type", "String", "Font type for the message to display" },
				{ "message", "String", "The message to display" },
				{ "message_color_blue", "int",
						"Blue value for the message text color" },
				{ "message_color_green", "int",
						"Green value for the message texte color" },
				{ "message_color_red", "int",
						"Red value for the message text color" },
				{
						"scroll_direction",
						"int",
						"Direction of the scrolling, a positive"
								+ " value indicate left to right scrolling,"
								+ " negative value right from left" },
				{ "scroll_zone_background_color_blue", "int",
						"Blue value for the scroll zone backrgound color" },
				{ "scroll_zone_background_color_green", "int",
						"Green value for the scroll zone background color" },
				{ "scroll_zone_background_color_red", "int",
						"Red value for the scroll zone backrgound color" }, };

		return info;
	}

	/**
	 * Wait for 'animationSpeed' milliseconds and redraw the scene.
	 */
	private void pauseAnimation() {

		try {
			Thread.sleep(animationSpeed);
			repaint();
		} catch (InterruptedException ie) {
		}

	}

	/**
	 * Update the position of our message and redraw the the scene.
	 */
	private void updatePosition() {

		if (scrollDirection >= 0)
			for (x = (scrollZoneTopLeftCornerX - textWidth); x < scrollZoneBottomRightCornerX; x++)
				pauseAnimation();
		else
			for (x = scrollZoneBottomRightCornerX; x > (scrollZoneTopLeftCornerX - textWidth); x--)
				pauseAnimation();

	}
}

Conclusion

Tout ce dont vous avez besoin pour éxécuter cet applet se trouve dans le zip.

Pour ce qui est des noms de polices ils dépendent du système sur lequel est exécutée l'applet. Vous pourrez obtenir une liste des polices disponibles grâce à cette fonction. Cependant, si vous souhaitez mettre l'applet sur votre site je vous conseil d'utiliser des polices connues.

private void listFontNames() {

GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();

System.out.println("----- Font families -----");
String[] fontFamilyNames = ge.getAvailableFontFamilyNames();
for (int i = 0; i < fontFamilyNames.length; ++i)
System.out.println(fontFamilyNames[i]);

System.out.println();

Font[] allFonts = ge.getAllFonts();

System.out.println("----- Font names----- ");
for (int i = 0; i < allFonts.length; ++i)
System.out.println(allFonts[i].getName());
}

Voilà, si vous avez des critiques, suggestions ou idées d'amélioration n'hésitez pas.

 

Fichier Zip

Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
  •   __MACOSX
    •   AppletDefil
      • ._.DS_StoreTélécharger ce fichier [Réservé aux membres club]-1 octets
  •   AppletDefil

Télécharger le zip

Historique

05 août 2007 16:15:53 :
- Applet plus configurable - Correction d'un bug dans le scrolling

Commentaires et avis

signaler à un administrateur
Commentaire de lasurprise1 le 15/08/2004 14:04:23

il y a un problème avec applet il part de la fin du message jusqu'au premier mot que tu as écris plutot de partir du premier mot jusqu'a la fin du message a part ça il es super continu

signaler à un administrateur
Commentaire de dreamkiller_52 le 23/12/2004 23:42:28

Enfin l'applet que je cherchai tant un grand merci a toi

Ajouter un commentaire

Discussions en rapport avec ce code source dans le forum

horizontal scrolling ds un JTextPane [ par infojava ] bonjour tt le monde .j ai un probleme avec le composant JTextPane.j associe mon composant "zone"&nbsp; qui est un JTextPane a un JScrollPane et je raj transformation d'application en applet!!! [ par steflanul ] Bonsoir&nbsp; ou bonjour &#224; tout les programmeurs JAVA!je recherche un peu d'aide car je dois transformer une application Java en une applet et j' Applet + Java3D [ par chabfive ] Salut,J'ai r&#233;alis&#233; une Applet qui charge un objet 3D VRML et qui permet de le visualiser. Cette Applet fonctionne tr&#232;s bien lorsque je java3D + Applet [ par chabfive ] Salut, J'ai r&#233;alis&#233; une Applet qui charge un objet 3D VRML et qui permet de le visualiser. Cette Applet fonctionne tr&#232;s bien lorsque j Jupload: applet de telechargement JSP [ par tamazirte ] Bonjour,J'essaie d'utilser Jupload mais sans r&#233;ussite"Error:java.net.connectException/Connection refused/connect" qlq'un peut m'aider svp?Je ne p trnasformer une application java en une applet [ par steflanul ] s'il vous plait aider moi c'est urgent!! je dois transfromer une application java en une applet et je ne sais pas comment faire !!! merci d'avance &#2 cherche API editeur graphique [ par redouane83 ] salut, je cherche un editeur graphique qui resemble a l'applet EditDraw mais en API, si quelqu'un peut m'en proposer un , ou me montrer comment transf JTextPane defilement horizontal [ par infojava ] bonjour tt le monde . j ai un probleme avec le composant JTextPane. j associe mon composant "zone" qui est un JTextPane a un JScrollPane et je rajout JDBC => java.security.AccessControlException [ par alonsyl ] bonjour,j'ai une applet depuis laquelle j'essaie d'interroger 1 BDD MS Access. tout marche comme il faut depuis eclipse mais ca foire quand je prends Recuperation Parametres Applet [ par chrcharles ] Bonjour, getParameter permet de r&#233;cup&#233;rer le nom et la valeur des param&#232;tres pass&#233;s pour une Applette. Mais comment faire pour r&


Nos sponsors

Sondage...

CalendriCode

Décembre 2008
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Téléchargements

Logiciels à télécharger sur le même thème :



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel BAÏSE, Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,374 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.