Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Java to HTML, enable user to enter a number of menu items

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java to HTML, enable user to enter a number of menu items

    I have this code:

     
    package sitecreator;
     
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
     
     
    public class MainForm extends javax.swing.JFrame {
     
        public MainForm() {
            initComponents();
        }
     
     
        String getData()
        {
            FileReader fr = null;
            StringBuilder html = new StringBuilder();
            try
            {
                fr = new FileReader("template.html");
                int b;
                    while ((b = fr.read()) != -1) {
                        html.append(Character.toString((char) b));
                    }
                    fr.close();
            }
            catch(IOException ex) { JOptionPane.showMessageDialog(epContent, "Error loading template!"); }
            return html.toString();
        }
    String insertData(String template)
    {
        String[] meniPrvi = {"###menu1Link###", "###menu1Title###","###menu2Link###","###menu2Title###",
                             "###menu3Link###", "###menu3Title###", "###menu4Link###", "###menu4Title###",
                             "###menu5Link###", "###menu5Title###", "###menu6Link###","###menu6Title###",
                             "###image1###", "###image2###", "###content###", "###footer###", "#FF9900", "#FF9901"};
        String[] meniDrugi = {tbMenu1Link.getText(),tbMenu1Title.getText(),tbMenu2Link.getText(),tbMenu2Title.getText(),
                              tbMenu3Link.getText(),tbMenu3Title.getText(),tbMenu4Link.getText(), tbMenu4Title.getText(),
                              tbMenu5Link.getText(), tbMenu5Title.getText(), tbMenu6Link.getText(),tbMenu6Title.getText(),
                              tbImage1.getText(), tbImage2.getText(), epContent.getText(), epFooter.getText(),
                              menuColor.getText(), footerColor.getText()};
       for (int i = 0; i<meniPrvi.length; i++){
           template = template.replace(meniPrvi[i], meniDrugi[i]);
       }
     
            return template;
    }
     
     
    void saveData(String data)
    {
            JFileChooser jfc = new JFileChooser();
            jfc.setVisible(true);
            jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
     
                @Override
                public boolean accept(File f) {
                     if (f.isDirectory())
                            return true;
                        String fn = f.getName();
                        String e="";
                        int i = fn.lastIndexOf('.');
                        if (i > 0 &&  i < fn.length() - 1) {
                            e = fn.substring(i+1).toLowerCase();
                        }
                        if(e.equals("html"))
                            return true;
                        else
                            return false;
                }
                @Override
                public String getDescription() {
                     return "html files";
                }
            });
            int res = jfc.showSaveDialog(this);
            if(res!=JFileChooser.CANCEL_OPTION&&jfc.getSelectedFile()!=null)
                {
                FileWriter fw = null;
     
                try {
                    fw = new FileWriter(jfc.getSelectedFile());
                    fw.write(data);
                    fw.close();
                    JOptionPane.showMessageDialog(epContent, "Dokumenat je uspješno sačuvan.");
                } catch (IOException ex) {  }
                finally {
                try {  fw.close();  } catch (IOException ex) {  }
                }
                }
           else JOptionPane.showMessageDialog(rootPane, "File not selected!");
    }
     
     
        /** 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() {
     
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            tbMenu1Title = new javax.swing.JTextField();
            tbMenu1Link = new javax.swing.JTextField();
            tbMenu2Title = new javax.swing.JTextField();
            tbMenu3Title = new javax.swing.JTextField();
            tbMenu2Link = new javax.swing.JTextField();
            tbMenu3Link = new javax.swing.JTextField();
            tbMenu4Title = new javax.swing.JTextField();
            tbMenu5Title = new javax.swing.JTextField();
            tbMenu6Title = new javax.swing.JTextField();
            tbMenu4Link = new javax.swing.JTextField();
            tbMenu5Link = new javax.swing.JTextField();
            tbMenu6Link = new javax.swing.JTextField();
            jScrollPane1 = new javax.swing.JScrollPane();
            epContent = new javax.swing.JEditorPane();
            jScrollPane2 = new javax.swing.JScrollPane();
            epFooter = new javax.swing.JEditorPane();
            Generate = new javax.swing.JButton();
            tbImage1 = new javax.swing.JButton();
            tbImage2 = new javax.swing.JButton();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel7 = new javax.swing.JLabel();
            menuColor = new javax.swing.JTextField();
            footerColor = new javax.swing.JTextField();
            addFiled = new javax.swing.JButton();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
     
            jLabel1.setText("Menu options ");
     
            jLabel2.setText("Content text");
     
            jLabel3.setText("Footer text");
     
            jLabel4.setText("Images");
     
            jScrollPane1.setViewportView(epContent);
     
            jScrollPane2.setViewportView(epFooter);
     
            Generate.setText("Generate");
            Generate.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    GenerateActionPerformed(evt);
                }
            });
     
            tbImage1.setText("Slika 1");
            tbImage1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    tbImage1ActionPerformed(evt);
                }
            });
     
            tbImage2.setText("Slika 2");
            tbImage2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    tbImage2ActionPerformed(evt);
                }
            });
     
            jLabel5.setText("Colors");
     
            jLabel6.setText("Menu bg color:");
     
            jLabel7.setText("Footer bg color:");
     
            addFiled.setText("Add field");
            addFiled.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    addFiledActionPerformed(evt);
                }
            });
     
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addContainerGap(400, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel2)
                            .addContainerGap(405, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel3)
                            .addContainerGap(412, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel4)
                            .addContainerGap(432, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(tbMenu6Title, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(tbMenu5Title, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(tbMenu4Title, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(tbMenu1Title, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                                        .addComponent(tbMenu2Title, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(tbMenu3Title, javax.swing.GroupLayout.Alignment.LEADING))
                                    .addGap(48, 48, 48)
                                    .addComponent(addFiled)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 68, Short.MAX_VALUE)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(tbMenu2Link)
                                        .addComponent(tbMenu3Link)
                                        .addComponent(tbMenu1Link, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
                                        .addComponent(tbMenu4Link)
                                        .addComponent(tbMenu5Link)
                                        .addComponent(tbMenu6Link)))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addGap(153, 153, 153)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(menuColor, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)
                                        .addComponent(tbImage2, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(footerColor, javax.swing.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE))))
                            .addGap(20, 20, 20))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(tbImage1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(Generate)
                            .addContainerGap())
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel5)
                            .addContainerGap(437, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel6)
                            .addContainerGap(396, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel7)
                            .addContainerGap(390, Short.MAX_VALUE))))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu1Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu1Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu2Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu2Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu3Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu3Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu4Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu4Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu5Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu5Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbMenu6Title, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tbMenu6Link, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(addFiled))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel4)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbImage1)
                        .addComponent(tbImage2))
                    .addGap(18, 18, 18)
                    .addComponent(jLabel5)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6)
                        .addComponent(menuColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(footerColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                    .addComponent(Generate)
                    .addContainerGap())
            );
     
            pack();
        }// </editor-fold>                        
     
        private void GenerateActionPerformed(java.awt.event.ActionEvent evt) {                                         
            saveData(insertData(getData()));
        }                                        
     
        private void tbImage1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        JFileChooser jfc = new JFileChooser();
           jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
     
     @Override
     public boolean accept(File f) {
     if (f.isDirectory())
     return true;
     String fn = f.getName();
     String e="";
     int i = fn.lastIndexOf('.');
     if (i > 0 && i < fn.length() - 1) {
     e = fn.substring(i+1).toLowerCase();
     }
     if(e.equals("jpg")|| e.equals("gif")|| e.equals("png")
     || e.equals("tif")|| e.equals("jpeg")|| e.equals("tiff"))
     return true;
     else
     return false;
     }
     
     @Override
     public String getDescription() {
     return "Image files";
     }
     });
     
     
     int status = jfc.showOpenDialog(null);
     String s= "";
     if (status == JFileChooser.APPROVE_OPTION){
     s =(jfc.getSelectedFile()).toString();
     tbImage1.setText(s); }
     else if (status ==JFileChooser.CANCEL_OPTION)
     tbImage1.setText("Please select image file!");
     
     
        }                                        
     
        private void tbImage2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        JFileChooser jfc = new JFileChooser();
           jfc.setFileFilter(new javax.swing.filechooser.FileFilter() {
     
     @Override
     public boolean accept(File f) {
     if (f.isDirectory())
     return true;
     String fn = f.getName();
     String e="";
     int i = fn.lastIndexOf('.');
     if (i > 0 && i < fn.length() - 1) {
     e = fn.substring(i+1).toLowerCase();
     }
     if(e.equals("jpg")|| e.equals("gif")|| e.equals("png")
     || e.equals("tif")|| e.equals("jpeg")|| e.equals("tiff"))
     return true;
     else
     return false;
     }
     
     @Override
     public String getDescription() {
     return "Image files";
     }
     });
     
     
     int status = jfc.showOpenDialog(null);
     String s= "";
     if (status == JFileChooser.APPROVE_OPTION){
     s =(jfc.getSelectedFile()).toString();
     tbImage2.setText(s); }
     else if (status ==JFileChooser.CANCEL_OPTION)
     tbImage2.setText("Please select image file!");
        }                                        
     
        private void addFiledActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
     
     
        }                                        
     
     
     
     
     
        /**
        * @param args the command line arguments
        */
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MainForm().setVisible(true);
                }
            });
        }
     
        // Variables declaration - do not modify                     
        private javax.swing.JButton Generate;
        private javax.swing.JButton addFiled;
        private javax.swing.JEditorPane epContent;
        private javax.swing.JEditorPane epFooter;
        private javax.swing.JTextField footerColor;
        private javax.swing.JLabel jLabel1;
        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.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JTextField menuColor;
        private javax.swing.JButton tbImage1;
        private javax.swing.JButton tbImage2;
        private javax.swing.JTextField tbMenu1Link;
        private javax.swing.JTextField tbMenu1Title;
        private javax.swing.JTextField tbMenu2Link;
        private javax.swing.JTextField tbMenu2Title;
        private javax.swing.JTextField tbMenu3Link;
        private javax.swing.JTextField tbMenu3Title;
        private javax.swing.JTextField tbMenu4Link;
        private javax.swing.JTextField tbMenu4Title;
        private javax.swing.JTextField tbMenu5Link;
        private javax.swing.JTextField tbMenu5Title;
        private javax.swing.JTextField tbMenu6Link;
        private javax.swing.JTextField tbMenu6Title;
        // End of variables declaration                   
     
     
     
    }

    The result is the GUI in attachment.

    Here is the problem: I need to use button "Add field" to enable user to add two more text fields every time the button is clicked. The left field represents link name and the right text field represents link address. After those fields are entered the app uses these values to generate html document (based on a template). With the current code user can enter only six menu links (and their addresses). I need to leave the possibility for the user to use "Add field" button to add more than six menu links.
    Attached Images Attached Images


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,145
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Java to HTML, enable user to enter a number of menu items

    add two more text fields every time the button is clicked
    Are you asking how to add textfield commponents to the GUI?
    For example if the GUI currently shows 4 textfields, pressing the button will change the number of textfields to 6.

    There is a lot of IDE generated code. That will make it harder to manually change the code as you want.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,145
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Java to HTML, enable user to enter a number of menu items

    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Junior Member
    Join Date
    Nov 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java to HTML, enable user to enter a number of menu items

    Quote Originally Posted by Norm View Post
    Are you asking how to add textfield commponents to the GUI?
    For example if the GUI currently shows 4 textfields, pressing the button will change the number of textfields to 6.

    There is a lot of IDE generated code. That will make it harder to manually change the code as you want.
    Yes. And pressing the button again will change the number of textfields to 8, but would not change the values of already existing textfields, it will just add two more fields. The problem with the code is that I cannot change it entirely because the task is to make only necessary changes to already existing code to enable adding more text fields and using the content of those fields to generate an HTML file.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,145
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Java to HTML, enable user to enter a number of menu items

    If you'd rewrite the code to get away from the IDE generated code, it'd be easier to modify.
    * WARNING: Do NOT modify this code
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. How To Ask the User to Enter Another Number Using the Number 1
    By Pettsa in forum Object Oriented Programming
    Replies: 6
    Last Post: May 3rd, 2012, 03:44 AM
  2. Trying to get Java to ask the user for a number
    By SunsetSkies in forum What's Wrong With My Code?
    Replies: 7
    Last Post: February 26th, 2012, 06:18 PM
  3. Have user enter in 2 inputs instead of using -1 to end. Help appreciated!
    By neontiger in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 21st, 2012, 04:26 AM
  4. Replies: 5
    Last Post: August 11th, 2011, 12:39 PM
  5. Is it possible to use card layout for menu and menu items?
    By jai2rul in forum AWT / Java Swing
    Replies: 0
    Last Post: April 11th, 2011, 08:19 AM