Results 1 to 20 of 20
  1. #1
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default Applet Problem (With Pictures)

    Hello All!

    I am having an issue getting an applet i wrote to appear on our website. After reading the posting guidelines, I noticed that you guys like to see error messages. But, there is no error message. So, I included some pictures of what is happening to tell the tale.

    The applet doesnt do much, it has a number of JTextFields, and JComboBoxes. The user enters values into the fields, then selects a value from the boxes, and the applet performs a weighted average for the user.

    The Applet does have an external image (not drawn by the applet) involved. The name of the JApplet is FFXIVCraftingCalculatorJApplet and it is in the package FFXIV. The Image file it uses is BlankMenu.JPG

    In Netbeans, this works as shown here:



    But, that's when i run the applet in Netbeans... When i post it to the site using this code:





    I get this window with a scrolling circle:



    After its done, i end up with nothing but a black square as shown here:



    I just do not understand where the problem is... so please forgive the posting of the entire code, i am new to all of this. I know you guys want me, ideally, to cut out portions of the code which do not pertain to the issue, but i do not even know what issue i have.

    Java Code:
    package FFXIV;
    
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    
    import javax.swing.JApplet;
    import java.awt.*;
    import java.awt.event.*;
    /**
     *
     * @author Jon
     */
    public class FFXIVCraftingCalculatorJApplet extends JApplet {
    
            /** Creates new form CraftingCalculator */
        public FFXIVCraftingCalculatorJApplet() {
            initComponents();
        }
    
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
    
            jLayeredPane1 = new javax.swing.JLayeredPane();
            backgroundImagePanel = new javax.swing.JPanel();
            backgroundImage = new javax.swing.JLabel();
            componantPane = new javax.swing.JLayeredPane();
            itemRank4 = new javax.swing.JTextField();
            itemRank1 = new javax.swing.JTextField();
            itemRank2 = new javax.swing.JTextField();
            itemRank7 = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            itemQuality4 = new javax.swing.JComboBox();
            itemQuality1 = new javax.swing.JComboBox();
            itemQuality2 = new javax.swing.JComboBox();
            itemQuality3 = new javax.swing.JComboBox();
            jLabel7 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jLabel9 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            itemRank5 = new javax.swing.JTextField();
            itemRank6 = new javax.swing.JTextField();
            itemRank3 = new javax.swing.JTextField();
            itemRank8 = new javax.swing.JTextField();
            itemQuality5 = new javax.swing.JComboBox();
            itemQuality6 = new javax.swing.JComboBox();
            itemQuality7 = new javax.swing.JComboBox();
            itemQuality8 = new javax.swing.JComboBox();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            calculate = new javax.swing.JButton();
            answer = new javax.swing.JLabel();
            title = new javax.swing.JLabel();
    
            jLayeredPane1.setBackground(new java.awt.Color(0, 0, 0));
    
            backgroundImagePanel.setBackground(new java.awt.Color(0, 0, 0));
    
            backgroundImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("BlankMenu.JPG"))); // NOI18N
            backgroundImage.setText("jLabel1");
            backgroundImage.setAlignmentY(20.0F);
    
            itemRank4.setColumns(3);
            itemRank4.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank4.setText("0");
            itemRank4.setToolTipText("Item rank can be found in the Item Description");
            itemRank4.setMinimumSize(new java.awt.Dimension(30, 20));
            itemRank4.setName(""); // NOI18N
            itemRank4.setBounds(149, 105, 40, 20);
            componantPane.add(itemRank4, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank1.setColumns(3);
            itemRank1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank1.setText("0");
            itemRank1.setToolTipText("Item rank can be found in the Item Description");
            itemRank1.setPreferredSize(new java.awt.Dimension(40, 20));
            itemRank1.setBounds(149, 30, 40, 20);
            componantPane.add(itemRank1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank2.setColumns(3);
            itemRank2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank2.setText("0");
            itemRank2.setToolTipText("Item rank can be found in the Item Description");
            itemRank2.setBounds(149, 55, 40, 20);
            componantPane.add(itemRank2, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank7.setColumns(3);
            itemRank7.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank7.setText("0");
            itemRank7.setToolTipText("Item rank can be found in the Item Description");
            itemRank7.setBounds(369, 80, 40, 20);
            componantPane.add(itemRank7, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel2.setBackground(new java.awt.Color(230, 214, 112));
            jLabel2.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel2.setForeground(new java.awt.Color(249, 249, 245));
            jLabel2.setLabelFor(itemRank4);
            jLabel2.setText("Item");
            jLabel2.setRequestFocusEnabled(false);
            jLabel2.setVerifyInputWhenFocusTarget(false);
            jLabel2.setBounds(110, 58, 30, 20);
            componantPane.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel3.setBackground(new java.awt.Color(230, 214, 112));
            jLabel3.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel3.setForeground(new java.awt.Color(249, 249, 245));
            jLabel3.setLabelFor(itemRank4);
            jLabel3.setText("Quality");
            jLabel3.setRequestFocusEnabled(false);
            jLabel3.setVerifyInputWhenFocusTarget(false);
            jLabel3.setBounds(420, 10, 50, 20);
            componantPane.add(jLabel3, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel4.setBackground(new java.awt.Color(230, 214, 112));
            jLabel4.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel4.setForeground(new java.awt.Color(249, 249, 245));
            jLabel4.setLabelFor(itemRank4);
            jLabel4.setText("Item");
            jLabel4.setRequestFocusEnabled(false);
            jLabel4.setVerifyInputWhenFocusTarget(false);
            jLabel4.setBounds(110, 108, 30, 20);
            componantPane.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel5.setBackground(new java.awt.Color(230, 214, 112));
            jLabel5.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel5.setForeground(new java.awt.Color(249, 249, 245));
            jLabel5.setLabelFor(itemRank4);
            jLabel5.setText("Item");
            jLabel5.setRequestFocusEnabled(false);
            jLabel5.setVerifyInputWhenFocusTarget(false);
            jLabel5.setBounds(110, 83, 30, 20);
            componantPane.add(jLabel5, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality4.setToolTipText("Select Quality of Ingredient");
            itemQuality4.setBounds(200, 105, 60, 20);
            componantPane.add(itemQuality4, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality1.setToolTipText("Select Quality of Ingredient");
            itemQuality1.setBounds(200, 30, 60, 20);
            componantPane.add(itemQuality1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality2.setToolTipText("Select Quality of Ingredient");
            itemQuality2.setBounds(200, 55, 60, 20);
            componantPane.add(itemQuality2, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality3.setToolTipText("Select Quality of Ingredient");
            itemQuality3.setBounds(200, 79, 60, 20);
            componantPane.add(itemQuality3, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel7.setBackground(new java.awt.Color(230, 214, 112));
            jLabel7.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel7.setForeground(new java.awt.Color(249, 249, 245));
            jLabel7.setLabelFor(itemRank4);
            jLabel7.setText("Rank");
            jLabel7.setRequestFocusEnabled(false);
            jLabel7.setVerifyInputWhenFocusTarget(false);
            jLabel7.setBounds(150, 10, 40, 20);
            componantPane.add(jLabel7, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel8.setBackground(new java.awt.Color(230, 214, 112));
            jLabel8.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel8.setForeground(new java.awt.Color(249, 249, 245));
            jLabel8.setLabelFor(itemRank4);
            jLabel8.setText("Item");
            jLabel8.setRequestFocusEnabled(false);
            jLabel8.setVerifyInputWhenFocusTarget(false);
            jLabel8.setBounds(320, 32, 40, 20);
            componantPane.add(jLabel8, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel9.setBackground(new java.awt.Color(230, 214, 112));
            jLabel9.setFont(new java.awt.Font("Bell MT", 1, 14)); // NOI18N
            jLabel9.setForeground(new java.awt.Color(249, 249, 245));
            jLabel9.setLabelFor(itemRank4);
            jLabel9.setText("Item");
            jLabel9.setRequestFocusEnabled(false);
            jLabel9.setVerifyInputWhenFocusTarget(false);
            jLabel9.setBounds(110, 32, 30, 20);
            componantPane.add(jLabel9, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel6.setBackground(new java.awt.Color(230, 214, 112));
            jLabel6.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel6.setForeground(new java.awt.Color(249, 249, 245));
            jLabel6.setLabelFor(itemRank4);
            jLabel6.setText("Item");
            jLabel6.setRequestFocusEnabled(false);
            jLabel6.setVerifyInputWhenFocusTarget(false);
            jLabel6.setBounds(320, 58, 30, 20);
            componantPane.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel10.setBackground(new java.awt.Color(230, 214, 112));
            jLabel10.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel10.setForeground(new java.awt.Color(249, 249, 245));
            jLabel10.setLabelFor(itemRank4);
            jLabel10.setText("Item");
            jLabel10.setRequestFocusEnabled(false);
            jLabel10.setVerifyInputWhenFocusTarget(false);
            jLabel10.setBounds(320, 83, 30, 20);
            componantPane.add(jLabel10, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel11.setBackground(new java.awt.Color(230, 214, 112));
            jLabel11.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel11.setForeground(new java.awt.Color(249, 249, 245));
            jLabel11.setLabelFor(itemRank4);
            jLabel11.setText("Item");
            jLabel11.setRequestFocusEnabled(false);
            jLabel11.setVerifyInputWhenFocusTarget(false);
            jLabel11.setBounds(320, 108, 30, 20);
            componantPane.add(jLabel11, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank5.setColumns(3);
            itemRank5.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank5.setText("0");
            itemRank5.setToolTipText("Item rank can be found in the Item Description");
            itemRank5.setPreferredSize(new java.awt.Dimension(40, 20));
            itemRank5.setBounds(369, 30, 40, 20);
            componantPane.add(itemRank5, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank6.setColumns(3);
            itemRank6.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank6.setText("0");
            itemRank6.setToolTipText("Item rank can be found in the Item Description");
            itemRank6.setBounds(369, 55, 40, 20);
            componantPane.add(itemRank6, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank3.setColumns(3);
            itemRank3.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank3.setText("0");
            itemRank3.setToolTipText("Item rank can be found in the Item Description");
            itemRank3.setBounds(149, 80, 40, 20);
            componantPane.add(itemRank3, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemRank8.setColumns(3);
            itemRank8.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
            itemRank8.setText("0");
            itemRank8.setToolTipText("Item rank can be found in the Item Description");
            itemRank8.setMinimumSize(new java.awt.Dimension(30, 20));
            itemRank8.setBounds(369, 105, 40, 20);
            componantPane.add(itemRank8, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality5.setToolTipText("Select Quality of Ingredient");
            itemQuality5.setBounds(420, 30, 60, 20);
            componantPane.add(itemQuality5, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality6.setToolTipText("Select Quality of Ingredient");
            itemQuality6.setBounds(420, 55, 60, 20);
            componantPane.add(itemQuality6, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality7.setToolTipText("Select Quality of Ingredient");
            itemQuality7.setBounds(420, 79, 60, 20);
            componantPane.add(itemQuality7, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            itemQuality8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NQ", "HQ", "HQ2", "HQ 3" }));
            itemQuality8.setToolTipText("Select Quality of Ingredient");
            itemQuality8.setBounds(420, 105, 60, 20);
            componantPane.add(itemQuality8, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel12.setBackground(new java.awt.Color(230, 214, 112));
            jLabel12.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel12.setForeground(new java.awt.Color(249, 249, 245));
            jLabel12.setLabelFor(itemRank4);
            jLabel12.setText("Rank");
            jLabel12.setRequestFocusEnabled(false);
            jLabel12.setVerifyInputWhenFocusTarget(false);
            jLabel12.setBounds(370, 10, 40, 20);
            componantPane.add(jLabel12, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            jLabel13.setBackground(new java.awt.Color(230, 214, 112));
            jLabel13.setFont(new java.awt.Font("Bell MT", 1, 14));
            jLabel13.setForeground(new java.awt.Color(249, 249, 245));
            jLabel13.setLabelFor(itemRank4);
            jLabel13.setText("Quality");
            jLabel13.setRequestFocusEnabled(false);
            jLabel13.setVerifyInputWhenFocusTarget(false);
            jLabel13.setBounds(200, 10, 50, 20);
            componantPane.add(jLabel13, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            calculate.setFont(new java.awt.Font("Bell MT", 1, 14)); // NOI18N
            calculate.setForeground(new java.awt.Color(249, 249, 245));
            calculate.setText("Calculate");
            calculate.setBorder(null);
            calculate.setBorderPainted(false);
            calculate.setContentAreaFilled(false);
            calculate.setName("buttonCalculate"); // NOI18N
            calculate.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    calculateActionPerformed(evt);
                }
            });
            calculate.setBounds(460, 163, 90, 30);
            componantPane.add(calculate, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            answer.setBackground(new java.awt.Color(249, 249, 245));
            answer.setFont(new java.awt.Font("Bell MT", 1, 14)); // NOI18N
            answer.setForeground(new java.awt.Color(249, 249, 245));
            answer.setText("Initial Quality will be ");
            answer.setBounds(50, 170, 360, 16);
            componantPane.add(answer, javax.swing.JLayeredPane.DEFAULT_LAYER);
    
            title.setFont(new java.awt.Font("Bell MT", 1, 24)); // NOI18N
            title.setForeground(new java.awt.Color(249, 249, 245));
            title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            title.setText("FFXIV Crafting Calculator");
    
            javax.swing.GroupLayout backgroundImagePanelLayout = new javax.swing.GroupLayout(backgroundImagePanel);
            backgroundImagePanel.setLayout(backgroundImagePanelLayout);
            backgroundImagePanelLayout.setHorizontalGroup(
                backgroundImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                    .addGroup(backgroundImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(componantPane, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE))
                        .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                            .addGap(43, 43, 43)
                            .addComponent(title, javax.swing.GroupLayout.PREFERRED_SIZE, 516, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap())
                .addGroup(backgroundImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(backgroundImage, javax.swing.GroupLayout.PREFERRED_SIZE, 590, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            );
            backgroundImagePanelLayout.setVerticalGroup(
                backgroundImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(title, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(componantPane, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(13, Short.MAX_VALUE))
                .addGroup(backgroundImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(backgroundImagePanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(backgroundImage, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            );
    
            backgroundImagePanel.setBounds(0, 0, 610, 300);
            jLayeredPane1.add(backgroundImagePanel, javax.swing.JLayeredPane.DEFAULT_LAYER);
            backgroundImagePanel.getAccessibleContext().setAccessibleName("null");
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 611, Short.MAX_VALUE)
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
            );
    
            
        }// </editor-fold>
    
        private void calculateActionPerformed(java.awt.event.ActionEvent evt) {
            int r1;
            int r2;
            int r3;
            int r4;
            int r5;
            int r6;
            int r7;
            int r8;
            
            try {
                
                String rank4 = itemRank4.getText();
                r4 = Integer.parseInt(rank4);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank1 = itemRank1.getText();
            r1 = Integer.parseInt(rank1);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank2 = itemRank2.getText();
            r2 = Integer.parseInt(rank2);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank7 = itemRank7.getText();
            r7 = Integer.parseInt(rank7);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank5 = itemRank5.getText();
            r5 = Integer.parseInt(rank5);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank6 = itemRank6.getText();
            r6 = Integer.parseInt(rank6);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank3 = itemRank3.getText();
            r3 = Integer.parseInt(rank3);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            try {
            String rank8 = itemRank8.getText();
            r8 = Integer.parseInt(rank8);
            }
            catch (Exception e) {
                answer.setText("USER ERROR: Only Integers Accepted.");
                return;
            }
            int q4 = itemQuality4.getSelectedIndex();
            int q1 = itemQuality1.getSelectedIndex();
            int q2 = itemQuality2.getSelectedIndex();
            int q3 = itemQuality3.getSelectedIndex();
            int q5 = itemQuality5.getSelectedIndex();
            int q6 = itemQuality6.getSelectedIndex();
            int q7 = itemQuality7.getSelectedIndex();
            int q8 = itemQuality8.getSelectedIndex();
            int numerator = ((r1 * q1) + (r2 * q2) + (r3 * q3) + 
                    (r4 * q4) + (r5 * q5) + (r6 * q6) + (r7 * q7) + (r8 * q8)) *300;
            int denominator = (r1 + r1 + r3 + r4 + r5 + r6 + r7 + r8) * 3;
            int lowerLimit = (numerator/denominator);
            int upperLimit = lowerLimit + 10;
            answer.setText("Your initial Quality Rating will be between " 
                    + lowerLimit + " and " + upperLimit + ".");    
        }
    
        
        /**
         * Initialization method that will be called after the applet is loaded
         * into the browser.
         */
        public void init() {
            FFXIVCraftingCalculatorJApplet content = new FFXIVCraftingCalculatorJApplet();
            setContentPane(content);
            // TODO start asynchronous download of heavy resources
        }
        // Variables declaration - do not modify
        private javax.swing.JLabel answer;
        private javax.swing.JLabel backgroundImage;
        private javax.swing.JPanel backgroundImagePanel;
        private javax.swing.JButton calculate;
        private javax.swing.JLayeredPane componantPane;
        private javax.swing.JComboBox itemQuality1;
        private javax.swing.JComboBox itemQuality2;
        private javax.swing.JComboBox itemQuality3;
        private javax.swing.JComboBox itemQuality4;
        private javax.swing.JComboBox itemQuality5;
        private javax.swing.JComboBox itemQuality6;
        private javax.swing.JComboBox itemQuality7;
        private javax.swing.JComboBox itemQuality8;
        private javax.swing.JTextField itemRank1;
        private javax.swing.JTextField itemRank2;
        private javax.swing.JTextField itemRank3;
        private javax.swing.JTextField itemRank4;
        private javax.swing.JTextField itemRank5;
        private javax.swing.JTextField itemRank6;
        private javax.swing.JTextField itemRank7;
        private javax.swing.JTextField itemRank8;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        private javax.swing.JLayeredPane jLayeredPane1;
        private javax.swing.JLabel title;
        // End of variables declaration
        
        // TODO overwrite start(), stop() and destroy() methods
    }

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Quote Originally Posted by Willriker View Post
    But, there is no error message.
    Check the java console. On Firefox it is under Tools. Can't remember where on IE.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    Your <APPLET tag should have the CODE= attribute referring to the name of the class. I'm not sure what having only the codebase does. I thought the codebase was to refer to another folder if the class file was NOT in the folder with the html file.

  4. #4
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    Sorry it took so long, i had to figure out what java console was and how to enable it. It told me that the code tag was missing in the HTML. so i fixed that.

    But now, i am back to the original problem i was trying to fix before all of this. It was when i was getting this issue:

    Java Code:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Jon
    
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    
    load: class FFXIVCraftingCalculatorJApplet.class not found.
    java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet.class
    I believe it has to do with these squiggles that appeared when i enter the code tag.



    I dont know, i have been working on this particular issue for days now. I even took two days off to clear my head and come back with fresh eyes. I thought i had made progress, and was working on a different issue, but i guess im right back to square one with getting this to work.

    *edit* yeah codebase is used when the class is located in a different file than the html. The squiggles do not appear in the codebase line though. I was searching the web, and saw an example of how someone only used the codebase so i thought i was on the right track by omitting the code line. But, i guess that was wrong. And, im back to start.
    Last edited by Willriker; 08-17-2011 at 03:38 AM.

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    class FFXIVCraftingCalculatorJApplet.class not found.
    The browser is looking for a file named class.class in the FFXIVCraftingCalculatorJApplet package.
    In other words the class: FFXIVCraftingCalculatorJApplet.class

    The code= should reference the class not the file. Remove the .class

  6. #6
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    hmmm, say, i really appreciate you two being willing to give me advice on this. As I mentioned earlier, im have been searching for days about this issue.

    I see what your saying in that error message. That is interesting. I still get the dreaded red line though. It has become my enemy!



    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Jon

    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------

    load: class FFXIVCraftingCalculatorJApplet not found.
    java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet
    Looks like the same issue is still there. Could it be an issue with the coding in the JApplet itself? It works in Netbeans, but the worry i have is where it calls the image file. When i wrote the code, the image file was on my pc. But, now the image used is on the web, in the same area as the class fiel as shown in the OP, so i do not know if that changes things.

    Then again, the error message doesnt mention that being an issue.
    Last edited by Willriker; 08-17-2011 at 03:58 AM.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    Where are the files (html and class)?
    Why the codebase? Try putting the html and the class files in the same folder.
    The codebase should point to a folder, not to a file. Try removing the filename from the end.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You seem to have ignored my recommendation in your last thread about using the class's fully qualified name. Why?

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    That could help a lot.

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm referring to this thread and post: input-jtextfield.html which you seem to have ignored. Why answer your questions if you ignore the help given?

  11. #11
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    Yeah, i did try that. It did not work either. I made a new post because this is a different issue than the OP in that was. And, i thought it would be best to not confuse people willing to help with a thread that kept changing issues. If i was in the wrong, i really do apologize. That and i honestly thought i had gotten past that issue a differant way, only to find out that i didnt and i was right back to that issue... which made me feel like a @#$!

    I am trying to put this onto the website of a community I belong to. They have me in charge of the website. Its one of those modular deals, where they have certain modules that you can import and add. They also have an HTML area where you can create your own modules, and add items like widgets and what not. The issue is that i do not have access to the file path where the HTML's i write are stored. But, i do have access to a different file directory. The HTML segments i have been posting come from that HTML area, and I am trying to get it to see the .class i am able to upload to portion of the file directory that our website has access to seeing/modifying.

    I am able to place widgets into the html area, so i do not see why i shouldnt be able to get a simple applet to work.

    All in all its cool with me because i always wanted to get into JAVA and so it gave me the perfect excuse to get into it. Truth be told i also wanted to write more complicated applications to help me at work. But, i figured that writing a simple applet would be the perfect thing to get my feet wet. There are a couple other applets that i wanted to write as well, to add to the community, and for practice. This one being the simpler of the two applets I would like to write.




    Java Code:
    Java Plug-in 1.6.0_26
    Using JRE version 1.6.0_26-b03 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Jon
    
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    
    load: class FFXIVCraftingCalculatorJApplet not found.
    java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: FFXIVCraftingCalculatorJApplet
    Both the class and image file are located in "http://files.enjin.com.s3.amazonaws.com/65434/". I tried it with and without the last /.

    I was curious that maybe the web site was working against me. And I might need to make another website, linking that page to this one. One where i have complete control over the file paths. But, these modular sites are everywhere. It seems that its the only thing i can come across. besides i am not keen about having our website linking multiple web services together.

    It would end up in a maze of different services all meshed together. But, it was something i was thinking about exploring as the very, very last resort. besides, i was under the impression that codebase exists for this exact situation.
    Last edited by Willriker; 08-17-2011 at 04:47 AM.

  12. #12
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    I'm able to connect to your class file and get the error I was expecting you to get next:
    Java Plug-in 1.6.0_20
    Using JRE version 1.6.0_25-b06 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Owner

    ....

    java.lang.NoClassDefFoundError: FFXIVCraftingCalculatorJApplet (wrong name: FFXIV/FFXIVCraftingCalculatorJApplet)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:662)
    Exception: java.lang.NoClassDefFoundError: FFXIVCraftingCalculatorJApplet (wrong name: FFXIV/FFXIVCraftingCalculatorJApplet)
    The error here is because the class is in a package: FFXIV
    The class file must be in a folder with the name of the package: FFXIV and that folder must be in the folder pointed to by the codebase.

    My HTML:

    <HTML><BODY>
    <APPLET code=FFXIVCraftingCalculatorJApplet width=800 height=800 codebase=http://files.enjin.com/65434/>
    </applet.
    </body>
    </html>

  13. #13
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    Just tried that and its a no go...

    I am contacting the company that holds this site to see whats up. Im stumped. No matter what I have tried, I still get that red line under the .class file referenced in the code line.

    I guess ill try to find a site where i can put the html and .class in the same place to see what happens.

    Regrardless, ill let you guys know whats up. Unless you have any other ideas.

  14. #14
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    My html was able to read the class file from the site. The problem I had was that your class is in a package and the html and file configuration did not consider that.
    Still: your html is NOT finding the class file, mine did find it.

    You will need to resolve the package problem. Try removing the package statement from your code or move the class file to a FFXIV folder at the codebase.

  15. #15
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    I tried to remove the package statement from the code, but then error messages popped up on every line. I decided to put it back. Hehe, I guess that much red startled me a little. So, back to altering the HTML side of things, I made the folder again. And placed the .class and the .JPG into the folder. The folder name is FFXIV, the same as the package name mentioned in the code.



    Java Code:
    <HTML><BODY>
    
    
    <APPLET code="FFXIVCraftingCalculatorJApplet" 
            width=800 height=800 
            codebase="http://files.enjin.com/65434/FFXIV">
    
    
    </applet>
    </body>
    </html>
    Java Code:
    Java Plug-in 1.6.0_13
    Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\c31208
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    java.lang.NoClassDefFoundError: FFXIV/FFXIVCraftingCalculatorJApplet$1
    	at FFXIV.FFXIVCraftingCalculatorJApplet.initComponents(FFXIVCraftingCalculatorJApplet.java:303)
    	at FFXIV.FFXIVCraftingCalculatorJApplet.<init>(FFXIVCraftingCalculatorJApplet.java:19)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at java.lang.Class.newInstance0(Unknown Source)
    	at java.lang.Class.newInstance(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Then I changed the HTML to this, below. The only differance is that i moved the project name up from the CODEBASE to the CODE line. Same error message.

    Java Code:
    <HTML><BODY>
    
    
    <APPLET code="FFXIV.FFXIVCraftingCalculatorJApplet" 
            width=800 height=800 
            codebase="http://files.enjin.com/65434/">
    
    
    </applet>
    </body>
    </html>



    So, for haha's, I started playing around with the HTML a bit more. Mainly to see what would happen if i tried some of the other ideas in this thread. I put back in the FFXIV.classname.class on the CODE line. This time the error changed.

    Java Code:
    <HTML><BODY>
    
    
    <APPLET code="FFXIV.FFXIVCraftingCalculatorJApplet.class" 
            width=800 height=800 
            codebase="http://files.enjin.com/65434/">
    
    </applet>
    </body>
    </html>
    Java Code:
    Java Plug-in 1.6.0_13
    Using JRE version 1.6.0_13 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\c31208
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    java.lang.NoClassDefFoundError: FFXIV/[COLOR="darkred"]FFXIVCraftingCalculatorJApplet$1[/COLOR]	
             at FFXIV.FFXIVCraftingCalculatorJApplet.initComponents(FFXIVCraftingCalculatorJApplet.java:303)
    	at FFXIV.FFXIVCraftingCalculatorJApplet.<init>(FFXIVCraftingCalculatorJApplet.java:19)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at java.lang.Class.newInstance0(Unknown Source)
    	at java.lang.Class.newInstance(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    I remember seeing that, highlighted, FFXIVCraftingCalculatorJApplet$1.class in the same directory as the FFXIVCraftingCalculatorJApplet.class on my PC. Should I have that ...$1.class on the website as well? I dont even know what that file is; I do not know what to google to understand it better.

  16. #16
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    Looks like you have gotten the files and paths adjusted correctly.
    Should I have that ...$1.class on the website as well?
    Yes you need all the .class files that are created when you compile the program.

  17. #17
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    I see, i guess its called an Anonymous Class. It must have come about when i was goign about the event handling? Interesting Stuff. I do not have access to the anonymous Class here, im on lunch break. Once i get home, i will upload the Anonymous Class and cross my fingers! Come to think of it, i just might cover my eyes when i load that page again.

    Ill keep you posted on how it works out.
    Last edited by Willriker; 08-17-2011 at 07:29 PM.

  18. #18
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    Its alive! Its Alive!

  19. #19
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,409
    Rep Power
    25

    Default

    Congratulations.

  20. #20
    Willriker is offline Member
    Join Date
    Aug 2011
    Posts
    47
    Rep Power
    0

    Default

    Thank you all very much. I learned a tremendous amount doing this. The next applet will be a bit more complicated, but now that I have a MUCH better idea of how things work I feel very confident that i can do it.

    Thank you!

Similar Threads

  1. Replies: 22
    Last Post: 07-25-2012, 09:51 PM
  2. 3D pictures
    By mine0926 in forum Advanced Java
    Replies: 8
    Last Post: 10-27-2010, 01:43 AM
  3. Scrolling Applet Pictures Disappeared After Update.
    By MrPitBull in forum New To Java
    Replies: 10
    Last Post: 04-05-2009, 12:21 AM
  4. pictures
    By chalo in forum New To Java
    Replies: 2
    Last Post: 12-13-2008, 12:26 PM
  5. pictures...
    By whosadork in forum New To Java
    Replies: 1
    Last Post: 10-20-2008, 02:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •