artist = new JLabel("Artist"); album = new JLabel("Album"); title = new JLabel("Track"); time = new JLabel("Time");
top = new JPanel();//holds title right justified top.setOpaque(false); top.setLayout(new FlowLayout(FlowLayout.TRAILING)); top.setPreferredSize(new Dimension(500,110)); JLabel name = new JLabel("Java MP3 Player"); top.add(name);
theContainer.add(mainPanel); setLocation(50,100); }// end of initGUI()
the new button added is prevButton which follows all other JButton styles with roll over images etc. When I look closely at the running code there is a blank 'grey' 20 x 20 pixel square between the stop and pause JHButtons which is the place I expected to find prevButton. I tried it here after it failed to appear to the left of stopButton? still mystified?
it is clearly my college assignment. I'm reasonably happy with my code so far but this is really stumping me? any ideas for solving would be very much appreciated - love
Have you checked the image file names and that the images actually exist in the directory as listed? Also, I would check the case for all letters in the image name. If the directory lists image.gif, referencing the image with Image.GIF could potentially create problems. Because the blank area displays on your GUI, I'd guess you have a missing/improperly referenced image file.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)