I was trying to figure out how to insert pictures into Java, but as music in the background plays, the pictures alternate. It would be really great if someone could include the music code too. Thanks for any help in advance.
Luckly I already have(ish). I found this lying around with some other things I was messing with. Obviously this is not code that you ought to use (it is needlessly redundant in many aspects). It seems you do not know where to starty (you posted no code) anyway hope this helps you get started, good luck! Alos it does not include sound but I believe sound would be quite easy to add. http://stackoverflow.com/a/10237397
public class applet extends Applet
public void paint (Graphics g)
img = getImage(getCodeBase(), "a.jpg ");
img = getImage(getCodeBase(), "b.jpg ");
g.drawImage(img, 50, 50, 700, 500, this);
public int second()
Calendar now = Calendar.getInstance();
int mili = now.get(Calendar.SECOND);
wrong design, wrong notifiers, most important is repaint(); inside paint/PaintComponent (repaint from itself) caused endless loop with high CPU and GPU usage, missing there stop repainting for contianer or super.paint() as 1st code line in paint, otherwise nothing will be repainted correctly, only nice flickering
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...