Newsgroup: it.comp.java
Titolo: [repost] [help] [source] FullScreenApplet.java - Ecco un modo realizzare un'Applet Full Screen...

(..)
Questo dovrebbe funzionare (almeno come applicazione) , anche se e' da
perfezionare.
Ciao
 Massimo.
//--------------------[ FullScreenApplet.java ]---
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.URL;
import java.net.MalformedURLException;
public class FullScreenApplet extends Applet {
 
  static boolean DEBUG = true;
  static boolean APPLET = true;
  Button buttonOk = new Button("Ok");
  Label labelTitle = new Label("Title");
  Image img;
  Window window;
  Frame frame;
  ExtPanel extPanel;
 
  public FullScreenApplet() {
    if (DEBUG) System.out.println ("FullScreenApplet() called...");
    frame = new Frame("FullScreenApplet");
//    frame.setBackground(Color.black);
//    frame.hide();   
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    int SCREEN_WIDTH = dimension.width; 
    int SCREEN_HEIGHT = dimension.height; 
    window = new Window(frame); 
    window.setBounds (0, 0, SCREEN_WIDTH, SCREEN_HEIGHT+20); 
 
 
  } // FullScreenApplet
 
  public class buttonOkListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      if (DEBUG) System.out.println("Button Ok pressed.");
    }
  } // buttonOkListener
 
  static class windowListener extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
      if (DEBUG) System.out.println("Window closing...");
      System.exit(0);
    }
  } // windowListener
 
  public void init() {
    if (DEBUG) System.out.println("init() called...");
    //window.setLayout(null);
    buttonOk.addActionListener(new buttonOkListener());
    extPanel=new ExtPanel();
    extPanel.add(labelTitle);
    extPanel.add(buttonOk);
    window.add(extPanel,BorderLayout.CENTER);
    if (APPLET) {
      img = getImage(getCodeBase(), "image.jpg");
    } 
    else {
      img = Toolkit.getDefaultToolkit().getImage("image.jpg");
    }    
 
    MediaTracker tracker;
    tracker = new MediaTracker(extPanel);
    tracker.addImage(img, 0);
    try {
      tracker.waitForAll();
    } 
    catch (InterruptedException e) {
      System.err.println ("Error loading " + "image.gif" + ".");
    }
    window.show(); 
    window.requestFocus();
  } // init
 
  public void start() {
    if (DEBUG) System.out.println("start() called...");
  } // start
 
  public void paint(Graphics g) {
    if (DEBUG) System.out.println ("paint() called...");
     frame.getGraphics().drawImage (img, 100, 100, 200, 140, null,
this);
  } // paint
  public void update(Graphics g) {
    if (DEBUG) System.out.println ("update() called...");
    // frame.getGraphics().drawImage (img, 0, 0, this);
  } // update
  public static void main(String[] args) {
    if (DEBUG) System.out.println("main() called...");
    APPLET = false;
    FullScreenApplet applet = new FullScreenApplet();
    applet.init();
    applet.start();
  } // main
 
 
  class ExtPanel extends Panel{
  	public void paint(Graphics g){
  		super.paint(g);
	                g.drawImage (img, 20, 20, this);
  	}	
 
  }	
 
} // FullScreenApplet
--
Ma! chi ha reso la mia lingua cosě perfida da averle  fatto guidare e salvaguardare fino ad ora la mia pigrizia?
A.Rimbaud, "Una stagione all'inferno"

Questo dovrebbe funzionare (almeno come applicazione) , anche se e' da perfezionare.
Grazie per il tuo aiuto... proverò e ti faccio sapere!!!
Ma cambia nick :P
Bye