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();
     }
}

Looks like you create the window, increment the bar as fast as the CPU can go, then exit the app. You're lucky to see even a flash!

And "there are errors" isn't enough info. Exactly what error message on exactly what line?

the errors are the variables with the equal sign
it says cannot find symbol
symbol: class name, floralOption etc..
<identifier> expected
cannot find symbol: outputStr
cannot find symbol: showMessageDialog that comes with the outputStr
illegal start type

Exactly what error message on exactly what line?

The answer to "what line" should be a line number. "the variables with the equal sign" doesn't help at all. Also the "etc." suggests you are not sharing the whole of the error message.

And please correct your indentation - lines like 100/101 make it near impossible to see the overall structure of your code.

In short:
Correct indentation
Post corrected code
Post exact and complete error message(s).
OK?

Compiling 10 source files to C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\build\classes
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:115: ')' expected
if (Cut Flowers)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:115: not a statement
if (Cut Flowers)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:115: ';' expected
if (Cut Flowers)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:117: 'else' without 'if'
else
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:118: <identifier> expected
if (floralArrangement)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:119: <identifier> expected
System.out.print("Submit = $25.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:119: illegal start of type
System.out.print("Submit = $25.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:120: illegal start of type
else
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:121: <identifier> expected
if (Coursage)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:122: <identifier> expected
System.out.print("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:122: illegal start of type
System.out.print("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:123: illegal start of type
else
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:124: <identifier> expected
System.out.print("None");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:124: illegal start of type
System.out.print("None");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:128: illegal start of type
if (roses)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:128: <identifier> expected
if (roses)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: <identifier> expected
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: illegal start of type
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: illegal start of type
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: illegal start of type
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: illegal start of type
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:129: illegal start of type
System.out.print("$15.00" + "$5.00" );("$25.00" + "$5.00");("$10.00" + "$5.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:130: illegal start of type
else
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: <identifier> expected
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: illegal start of type
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: illegal start of type
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: illegal start of type
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: illegal start of type
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:131: illegal start of type
System.out.print("$15.00"); ("$25.00"); ("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:136: illegal start of type
if (Drop Off)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:136: ';' expected
if (Drop Off)
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:137: <identifier> expected
System.out.print("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:137: illegal start of type
System.out.print("$10.00");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:138: illegal start of type
else
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:139: <identifier> expected
ystem.out.print("PickUp");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralOrderGUI.java:139: illegal start of type
ystem.out.print("PickUp");
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:48: not a statement
customerName;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:56: not a statement
dominantFlower;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:64: not a statement
orderCost;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:72: not a statement
orderNo;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:80: not a statement
deliveryOption;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\floralOrder.java:88: not a statement
floralOption;
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:119: <identifier> expected
name =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:122: <identifier> expected
floralOption =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:125: <identifier> expected
deliveryOption =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:128: <identifier> expected
orderNo =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:131: <identifier> expected
orderCost =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:141: <identifier> expected
outputStr = "Name: " + name + "\n" + "FloralOption: " + floralOption + "\n" +
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:144: <identifier> expected
JOptionPane.showMessageDialog(null, outputStr, "ViewOrder",
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:144: illegal start of type
JOptionPane.showMessageDialog(null, outputStr, "ViewOrder",
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:153: <identifier> expected
name =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:156: <identifier> expected
floralOption =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:159: <identifier> expected
deliveryOption =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:162: <identifier> expected
orderNo =
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\src\floralorder\flowerOrder.java:165: <identifier> expected
orderCost =
55 errors
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\nbproject\build-impl.xml:413: The following error occurred while executing this line:
C:\Users\Juanelle\Documents\NetBeansProjects\floralOrder\nbproject\build-impl.xml:199: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)

Edited 6 Years Ago by chinee: n/a

This article has been dead for over six months. Start a new discussion instead.