Benvenuto in SeaMonkey Add-ons.
Aggiungi nuove funzionalità e stili per rendere SeaMonkey veramente tuo.
ChiudiRecensione di Tiger19 per Forestle
Assegnate 3 su 5 stelle
MJP
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JPanel;
public class MeinJPanel extends JPanel{
private int panelHoehe;
private int panelBreite;
private Image aktBild;
public MeinJPanel(int hoehe, int breite, Image bild){
this.setPanelHoehe(hoehe);
this.setPanelBreite(breite);
this.setAktBild(bild);
setBackground(Color.black);
}
public Dimension getPreferredSize(){
return new Dimension(this.panelBreite, this.panelHoehe);
}
public void paintComponent(Graphics g){
super.paintComponent(g);
if(aktBild != null){
g.drawImage(this.getAktBild(),0,0, this.getPanelBreite(), this.getPanelHoehe(), this);
}
else{
g.drawString("Kein Bild da!", this.getPanelBreite(), this.getPanelHoehe());
}
}
public int getPanelHoehe() {
return panelHoehe;
}
public void setPanelHoehe(int panelHoehe) {
this.panelHoehe = panelHoehe;
}
public int getPanelBreite() {
return panelBreite;
}
public void setPanelBreite(int panelBreite) {
this.panelBreite = panelBreite;
}
public Image getAktBild() {
return aktBild;
}
public void setAktBild(Image aktBild) {
this.aktBild = aktBild;
}
}
Per creare una tua raccolta devi avere un account per Mozilla Add-ons.