Wenn du etwas versierter in UI-Programmierung bist schau dir mal JLayer und LayerUI aus Java 7 an. Sonst sollte setBackground, wie PerfectMuffin es bereits vorgeschlagen hat, vollkommen ausreichend sein.

http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html

Hier noch ein Kommentar von stackoverflow der die Funktion von JLayer ziemlich gut beschreibt:

A JLayer can be used to dynamically enhance any of your existing components.

Say you have some custom button (say MyJButton) and you want to add a mouse over effect or maybe some shading. Traditionally you would create a new class that inherits from MyJButton that would implement your new features.

One problem with this is approach is that the new effects are only applicable to MyJButton (since your new class extends MyJButton). Another problem with this approach is that you can't change the enhancements / effects at run time, since inheritance relations are fixed at compile time.

Using a JLayer, you can put a LayerUI together with any existing Component (not just a JButton or MyJButton) in order to add your custom effects to a component. If you have a LayerUI that does shading, you can put it together with a JButton, JTextField, JPanel or any other component to perform that shading. You can also change the composition of LayerUIs and Components at run time.

The JLayer is just a special case of the decorator pattern

...zur Antwort

Die Java Insel sollt für Anfänger eigentlich die erste Anlaufstelle sein. Das ist meist was zu finden:

http://openbook.galileodesign.de/javainsel5/javainsel15_034.htm#Rxx747java150340400055A1F02D10A

...zur Antwort

Folgendes Script in ne Textdatei mit der Endung .vbs speichern und per Doppelklick ausführen:

Set myArrayList = CreateObject( "System.Collections.ArrayList" )

Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("Pfad_zu_deinem_Ordner")
Set subFlds = folder.SubFolders

For Each fld in subFlds
   myArrayList.Add fld
Next

Randomize
r = Int((myArrayList.Count)*Rnd())

MsgBox myArrayList(r)
...zur Antwort