Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wie setze ich elegant ein Hintergrundbild in ein JPanel?

Empfohlene Antworten

Moin,

ich habe unter

http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&oe=UTF-8&threadm=8tp52g%24pli%241%40nnrp1.deja.com&rnum=5&prev=/groups%3Fhl%3Dde%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dkacheln%2Bjava%26spell%3D1

folgendes gefunden:


public void paint (Graphics g){

if (hintergrundbild != null){

int x=0,y=0;

while(y<   this.getSize().height){

x=0;

while(x<this.getSize().width){

g.drawImage(hintergrundbild,x,y,this);

x=x+hintergrundbild.getWidth(null);

} y=y+hintergrundbild.getHeight(null);

}

}

else {

g.clearRect(0,0,this.getSize().width,this.getSize().height);

}

}

Die URL

http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&oe=UTF-8&threadm=8t3phq%24qp1%241%40news.netway.at&rnum=2&prev=/groups%3Fhl%3Dde%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Djpanel%2Bhintergrundbild%26sa%3DN%26tab%3Dwg%26meta%3D

Schien auch vielversprechend, habe den Code aber nicht ganz verstanden. :-)

Ich hoffe das hilft.

Gruß, Peter

  • Autor

Aye, danke.

Ich habe inzwischen eine andere Methode probiert. Hierbei adde ich ein JLabel auf das JPanel welches beim Konstruktor ein IconImage mit bekommt - e voila :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.