i created a flash screen but all i could get is a blue screen not even the picture is comin up and not even the menu is coming up.and plus there are errors from place order to change order with the variable and the equal sign. so can any one assisst in this code as well?
import java.awt.*;
import javax.swing.*;
import javax.swing.ImageIcon;
import java.awt.event.*;
import javax.swing.JOptionPane;
public class flowerOrder extends JWindow
{
private JProgressBar bar;
private JLabel ImageHolder;
private ImageIcon myImage;
private int i;
public flowerOrder(){
setBounds(60,60,600,600); //set location and size of the window
getContentPane().setBackground(Color.BLUE); //set the background color of the window
//create an image from suitable file
myImage = new ImageIcon("rose.GIF ");
ImageHolder = new JLabel(myImage);
bar = new JProgressBar(); //create a progress bar
bar.setMaximum(100); //set maximum value of the bar
bar.setStringPainted(true); //enables the display of text on the bar
setLayout(new BorderLayout()); //set the layout style of the window
//add elements to the window
add(ImageHolder, BorderLayout.CENTER);
add(bar, BorderLayout.SOUTH);
setVisible(true); //make the window visible
//incrementing the progress bar
String percent = "";
for (i = 0; i <= 100; i++)
{
for (long j=0; j<500000; ++j)
{
percent = " " + i + "%";
}
bar.setValue(i);
}
if(i==101)
System.exit(0);//dispose of the window or launch the first frame of your application
}
public class Menu {
JTextArea output;
JScrollPane scrollPane;
public JMenuBar createMenuBar() {
JMenuBar menuBar;
JMenu menu, submenu;
JMenuItem menuItem;
JRadioButtonMenuItem rbMenuItem;
JCheckBoxMenuItem cbMenuItem;
//Create the menu bar.
menuBar = new JMenuBar();
//Build the first menu.
menu = new JMenu("A Menu");
menu.setMnemonic(KeyEvent.VK_A);
menu.getAccessibleContext().setAccessibleDescription(
"The only menu in this program that has menu items");
menuBar.add(menu);
//a group of JMenuItems
menuItem = new JMenuItem("Place Order",
KeyEvent.VK_T);
//menuItem.setMnemonic(KeyEvent.VK_T); //used constructor instead
//a group of radio button menu items
menu.addSeparator();
ButtonGroup group = new ButtonGroup();
rbMenuItem = new JRadioButtonMenuItem("View Order");
rbMenuItem.setSelected(true);
rbMenuItem.setMnemonic(KeyEvent.VK_R);
group.add(rbMenuItem);
menu.add(rbMenuItem);
rbMenuItem = new JRadioButtonMenuItem("Change Order");
rbMenuItem.setMnemonic(KeyEvent.VK_O);
group.add(rbMenuItem);
menu.add(rbMenuItem);
return menuBar;
}
}
public class PlaceOrder{
String name, floralOption, deliveryOption;
int orderNo;
double orderCost;
name =
JOptionPane.showInputDialog("Enter Name: ");
floralOption =
JOptionPane.showInputDialog("Enter Floral OPtion: ");
deliveryOption =
JOptionPane.showInputDialog("Enter Delivery Option: ");
orderNo =
JOptionPane.showInputDialog("Enter Order Number: ");
orderCost =
JOptionPane.showInputDialog("Enter Order Cost: ");
}
public class ViewOrder extends PlaceOrder{
String name, floralOption, deliveryOption;
int orderNo;
double orderCost;
outputStr = "Name: " + name + "\n" + "FloralOption: " + floralOption + "\n" +
"DeliveryOtion: " + deliveryOption + "\n" + "OrderNo: " + orderNo + "\n" +
"OrderCost: " + orderCost + "\n";
JOptionPane.showMessageDialog(null, outputStr, "ViewOrder",
JOptionPane.INFORMATION_MESSAGE);
}
public class ChangeOrder{
String name, floralOption, deliveryOption;
int orderNo;
double orderCost;
name =
JOptionPane.showInputDialog("Enter Name: ");
floralOption =
JOptionPane.showInputDialog("Enter Floral OPtion: ");
deliveryOption =
JOptionPane.showInputDialog("Enter Delivery Option: ");
orderNo =
JOptionPane.showInputDialog("Enter Order Number: ");
orderCost =
JOptionPane.showInputDialog("Enter Order Cost: ");
}
public static void main(String[] args){
new flowerOrder();
}
}