Ciao a tutti,
ho appena trovato delle librerie carine, sono le MacWidgets e ho voluto utilizzarle.
Perciò dopo aver scaricato la libreria e installate su eclipse con il solito procedimento (seleziono il progetto, pulsante destro,proprieta e da li java build path, libreries, add external jars e ho caricato il file zip e poi sono andato su order and export per selezionarlo e poi ok). Se non erro è questo il procedimento.
Ho trovato un esempio in rete
codice:
package net.sourceforge.secchat.gui;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.sql.Date;
import java.util.Enumeration;
import java.util.Properties;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import com.explodingpixels.macwidgets.HudWidgetFactory;
import com.explodingpixels.macwidgets.HudWindow;
public class UnifiedToolBarWindow {
/**
* @param args
*/
private JLabel msnLabel;
private JLabel privateKeyIDLabel;
private JTextField msnAccount;
private JTextField privateKeyID;
private JDialog dialog;
private JButton button;
public UnifiedToolBarWindow(String email, String keyid) {
HudWindow hud = new HudWindow("Public Key ID festlegen");
Container cp = hud.getContentPane();
dialog = hud.getJDialog();
dialog.setSize(300, 140);
cp.setLayout(null);
button = HudWidgetFactory.createHudButton("Speichern");
button.setBounds(dialog.getSize().width / 2 - 45, 90, 90, 25);
button.setVisible(true);
msnLabel = HudWidgetFactory.createHudLabel("MSN-Account:");
msnLabel.setBounds(8, 20, 85, 20);
privateKeyIDLabel = HudWidgetFactory.createHudLabel("Private Key ID:");
privateKeyIDLabel.setBounds(8, 50, 87, 20);
msnAccount = HudWidgetFactory.createHudTextField("");
msnAccount.setBounds(120, 20, 150, 20);
msnAccount.setEnabled(false);
// Sets the E-Mail from the MSNContact
msnAccount.setText(email);
privateKeyID = HudWidgetFactory.createHudTextField("");
privateKeyID.setBounds(121, 50, 80, 20);
if (keyid != null)
privateKeyID.setText(keyid);
hud.getContentPane().add(msnLabel);
hud.getContentPane().add(msnAccount);
hud.getContentPane().add(privateKeyIDLabel);
hud.getContentPane().add(privateKeyID);
hud.getContentPane().add(button);
dialog.setLocationRelativeTo(null);
dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Save");
saveKeyID(msnAccount.getText(), privateKeyID.getText());
}
});
}
private void saveKeyID(String email, String keyid) {
String filename = System.getProperty("user.home") + "/msn-keys.properties";
try {
FileOutputStream propOutFile = new FileOutputStream(filename, true);
Properties p1 = new Properties();
p1.setProperty(email, keyid);
p1.store(propOutFile, null);
} catch (FileNotFoundException e) {
System.err.println("Canât find " + filename);
} catch (IOException e) {
System.err.println("I/O failed.");
}
}
/**
* @return the msnAccount
*/
public String getMsnAccount() {
return msnAccount.getText();
}
/**
* @param msnAccount
* the msnAccount to set
*/
public void setMsnAccount(String str) {
msnAccount.setText(str);
}
/**
* @return the privateKeyID
*/
public String getPrivateKeyID() {
return privateKeyID.getText();
}
/**
* @param privateKeyID
* the privateKeyID to set
*/
public void setPrivateKeyID(String str) {
privateKeyID.setText(str);
}
public static void main(String[] args) {
new UnifiedToolBarWindow("test@example.com", null);
// Ende Attribute
// Ende Komponenten
}
}
ma agli imports
import com.explodingpixels.macwidgets.HudWidgetFactory;
import com.explodingpixels.macwidgets.HudWindow;
mi da errore e quindi a tutte le sue cose in basso, per esempio ad HudWindow e a tutti gli altri Hud*.
Quindi in linea teorica non vede proprio la libreria che credo di averla caricata.
Come posso risolvere questo problema?
Grazie anticipatamente!