hello
22-05-2007, 00:08
come posso fare per utilizzare un diverso Look And Feel (es. Liquid) con il codice seguente, potete spiegarmi una volta scaricato il file liquidlnf-2.9.1.zip cosa bisogna aggiungere/modificare al codice seguente e in quale directory bisogna mettere i file scaricati, il file .zip contiene liquidlnf.jar e liquidlnftest.jar, io utilizzo NetBeans 5.5
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Prova extends JFrame
{
private JButton B1= new JButton();
private JButton B2= new JButton();
private JPanel c;
public Prova()
{
super();
c = (JPanel)this.getContentPane();
B1.setText("ESCI");
B2.setText("SELEZIONA");
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ B1_a(e);}
});
B2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ B2_a(e);}
});
c.setLayout(new GridLayout(1, 0, 0, 0));
c.add(B1, 0);
c.add(B2, 1);
this.setTitle("MIO PROGRAMMA");
this.setLocation(new Point(100, 100));
this.setSize(new Dimension(300,80));
this.setVisible(true);
}
private void B1_a(ActionEvent a)
{System.exit(0);}
private void B2_a(ActionEvent a)
{ JFileChooser zzz = new JFileChooser (); zzz.showOpenDialog (this);}
public static void main(String[] args)
{
try{ UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");}
catch (Exception ex){}
new Prova();
}
}
grazie!!! :help:
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Prova extends JFrame
{
private JButton B1= new JButton();
private JButton B2= new JButton();
private JPanel c;
public Prova()
{
super();
c = (JPanel)this.getContentPane();
B1.setText("ESCI");
B2.setText("SELEZIONA");
B1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ B1_a(e);}
});
B2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{ B2_a(e);}
});
c.setLayout(new GridLayout(1, 0, 0, 0));
c.add(B1, 0);
c.add(B2, 1);
this.setTitle("MIO PROGRAMMA");
this.setLocation(new Point(100, 100));
this.setSize(new Dimension(300,80));
this.setVisible(true);
}
private void B1_a(ActionEvent a)
{System.exit(0);}
private void B2_a(ActionEvent a)
{ JFileChooser zzz = new JFileChooser (); zzz.showOpenDialog (this);}
public static void main(String[] args)
{
try{ UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");}
catch (Exception ex){}
new Prova();
}
}
grazie!!! :help: