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 7 of 7

Thread: Dear sir or Viewer before reply please read the code even you not understand what i have doing

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    15
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Dear sir or Viewer before reply please read the code even you not understand what i have doing

    this below my project a part where i have been sing generate button in inward TextField, but not able to make sure.
    please watch the picture. mostly see the generate action performed block.

    JMenuItem home = new JMenuItem("Inward AWB Bill");
    home.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent as){
    JFrame frame1 = new JFrame("Inward Table");
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLO SE);
    frame1.setSize(800,600);
    frame1.setResizable(false);
    frame1.setLocationRelativeTo(null);
    frame1.setVisible(true);

    JPanel panel1 = new JPanel();
    panel1.setSize(500,400);
    //getContentPane().add(panel);
    panel1.setLayout(null);

    JLabel inward =new JLabel("Inward");
    inward.setSize(100,30);
    inward.setLocation(50,50);
    //inward.setEditable(false);
    inward.setFont(new Font("Arial",Font.BOLD,13));

    final JTextField inwardField =new JTextField();
    inwardField.setSize(150,30);
    inwardField.setLocation(190,50);
    inwardField.setFont(new Font("Arial",Font.BOLD,13));


    JLabel fromin = new JLabel("From Bill No");
    fromin.setSize(110,30);
    fromin.setLocation(350,50);
    //from.setEditable(false);
    fromin.setFont(new Font("Arial",Font.BOLD,13));

    final JTextField fromFieldin = new JTextField();
    fromFieldin.setSize(100,30);
    fromFieldin.setLocation(440,50);
    fromFieldin.setFont(new Font("Arial",Font.BOLD,13));

    JLabel toin = new JLabel("To Bill No");
    toin.setSize(100,30);
    toin.setLocation(540,50);
    //to.setEditable(false);
    toin.setFont(new Font("Arial",Font.BOLD,13));

    final JTextField toFieldin = new JTextField();
    toFieldin.setSize(100,30);
    toFieldin.setLocation(610,50);
    toFieldin.setFont(new Font("Arial",Font.BOLD,13));

    JLabel inwardDate = new JLabel("Date Of Inward");
    inwardDate.setSize(100,30);
    inwardDate.setLocation(50,90);
    //inwardDate.setEditable(false);
    inwardDate.setFont(new Font("Arial",Font.BOLD,13));

    final JTextField inwardDateField = new JTextField();
    inwardDateField.setSize(150,30);
    inwardDateField.setLocation(190,90);
    inwardDateField.setFont(new Font("Arial",Font.BOLD,13));

    JLabel inwardBy = new JLabel("Inward By");
    inwardBy.setSize(100,30);
    inwardBy.setLocation(50,130);
    //inwardBy.setEditable(false);
    inwardBy.setFont(new Font("Arial",Font.BOLD,13));

    final JTextField inwardByField = new JTextField();
    inwardByField.setSize(150,30);
    inwardByField.setLocation(190,130);
    inwardByField.setFont(new Font("Arial",Font.BOLD,13));

    comboBox = new JComboBox<String>();
    comboBox.setSize(100,30);
    comboBox.setLocation(350, 500);



    JButton savea = new JButton("Save");
    savea.setSize(70,30);
    savea.setLocation(90,250);
    savea.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    savea();
    }

    private void savea() {
    String inField =inwardField.getText();
    String indate = inwardDateField.getText();
    String inby = inwardByField.getText();
    addToDB(inField,indate,inby);
    }
    private void addToDB(String inField, String indate, String inby) {

    String quary=("insert into inward(inward, inwardDate, inward By )values('"+inField+"','"+indate+"','"+inby+"')");
    Connectionn.executeInsert(quary);
    populateComboBox();
    }
    });

    JButton edit = new JButton("Edit");
    edit.setSize(70,30);
    edit.setLocation(170,250);
    edit.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){

    }
    });

    final JButton exit = new JButton("Exit");
    exit.setSize(70,30);
    exit.setLocation(250,250);
    exit.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent we){
    if(we.getSource()==exit){
    System.exit(0);

    }

    }
    });

    JButton generatei = new JButton("Auto Generate ");
    generatei.setToolTipText("For Auto generate Bill Only Can Use This Button");
    generatei.setSize(120,30);
    generatei.setLocation(520,100);

    generatei.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent r){
    generatei();
    }
    private void generatei() {

    String in =inwardField.getText();
    String start=fromFieldin.getText();
    String end=toFieldin.getText();
    in="13276125962"; // section i have been doubt don't how to manage below mention field.
    start="13276125962";
    end="100000000000";
    String increment="11";

    for(String i=start;i<= end;i+=increment)
    addToDB(in,start,end);
    }
    private void addToDB(String in,String start,String end) {

    String quary=("insert into inward(inward,fromFieldin,toFieldin)values('"+in+" ','"+start+"','"+end+"')");
    Connectionn.executeInsert(quary);

    }
    });
    frame1.add(panel1);
    panel1.add(inward);
    panel1.add(inwardField);

    panel1.add(inwardDate);
    panel1.add(inwardDateField);
    panel1.add(inwardBy);
    panel1.add(inwardByField);
    panel1.add(savea);
    panel1.add(edit);
    panel1.add(exit);
    panel1.add(comboBox);
    panel1.add(fromin);
    panel1.add(fromFieldin);
    panel1.add(toin);
    panel1.add(toFieldin);
    panel1.add(generatei);


    }

    });
    Attached Images Attached Images


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    Please read the Announcements pageDo you have a question?

  3. #3
    Junior Member
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    15
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    if your a export in java then no need such rule because, u know na what is call teacher ??

  4. #4
    Junior Member
    Join Date
    May 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    What is connectionn supposed to be, and in the code you gave us populateComboBox() doesn't exist.

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    3,434
    My Mood
    Mellow
    Thanks
    86
    Thanked 474 Times in 465 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    Troll.

  6. #6
    Junior Member
    Join Date
    May 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    Quote Originally Posted by GregBrannon View Post
    Troll.
    I figured as much but I couldn't tell if the guy was foreign and couldn't type in English well so I didn't want to be rude XD

  7. #7
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    3,434
    My Mood
    Mellow
    Thanks
    86
    Thanked 474 Times in 465 Posts

    Default Re: Dear sir or Viewer before reply please read the code even you not understand what i have doing

    In my experience, the people you describe are usually polite.

Similar Threads

  1. sir please help me how make sure addbutton, save button, or other
    By amul in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 26th, 2013, 12:46 AM
  2. Hi,Can any one help me to understand this code.Am a beginner.
    By Jawad24 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 23rd, 2013, 07:47 AM
  3. Replies: 5
    Last Post: November 14th, 2012, 09:47 AM
  4. Can't seem to understand whats wrong with my code! Help!!
    By aquir in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 2nd, 2011, 12:06 PM
  5. Dear sir
    By sandeep_mca in forum Member Introductions
    Replies: 1
    Last Post: February 11th, 2011, 07:37 AM