I need help inserting a picture, I would like the picture centered and on top of the JPanel above "JLabel Header 1"...where and how would i do this? I have this so far:
ImageIcon icon = new ImageIcon ("Taxi.jpg");
JPanel Driver1 = new JPanel();
Driver1.setPreferredSize (new Dimension(175, 125));
Driver1.setBackground (Color.green);
JLabel Header1 = new JLabel ("Name: " + fName + " " + lName);
JLabel MPG = new JLabel ("MPG: " + fmt.format(mpg));
JLabel FPM = new JLabel ("Fares per mile: " + cfmt.format(fpm));
JLabel GPPM = new JLabel ("Gas paid per mile: " + cfmt.format(gppm));
JLabel PROFIT = new JLabel ("Total Profit: " + cfmt.format(profit));
Driver1.add (Header1);
Driver1.add (MPG);
Driver1.add (FPM);
Driver1.add (GPPM);
Driver1.add (PROFIT);