display he new customer no in textbox

Ads
 

display he new customer no in textbox

i want to add the new customer for that when i click on add butto the new customernumber should be display in textfield . plz ell me the suggestions & code

View Answers

February 28, 2011 at 4:59 PM

Java Display new value to textbox:

import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.awt.event.*;
class TextFieldExample
{
    public static void main(String[] args){
    Frame f=new Frame();
    Label label1=new Label("No: ");
    Label label2=new Label("Name: ");
    Label label3=new Label("Address: ");
    final TextField text1=new TextField(20);
    final TextField text2=new TextField(20);
    final TextField text3=new TextField(20);
    text1.setText("1");
    Button b=new Button("Add");
    b.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
        int v1=Integer.parseInt(text1.getText());

        String v2=text2.getText();
        String v3=text3.getText();
        try{
           Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into user(id,name,address) values("+v1+",'"+v2+"','"+v3+"')");
           JOptionPane.showMessageDialog(null,"Data is inserted successfully");

        }
        catch(Exception ex){
            System.out.println(ex);
        }
        v1=v1+1;
           text1.setText(Integer.toString(v1));
           text2.setText("");
           text3.setText("");
        }
    });
        Panel p=new Panel(new GridLayout(5,2));
        p.add(label1);
        p.add(text1);
        p.add(label2);
        p.add(text2);
        p.add(label3);
        p.add(text3);
        p.add(b);
        f.add(p);
        f.setVisible(true);
        f.pack();
    }
}

Ads









Related Tutorials/Questions & Answers:
display he new customer no in textbox
display he new customer no in textbox   i want to add the new customer for that when i click on add butto the new customernumber should be display in textfield . plz ell me the suggestions & code
display data from database in textbox when id entered in textbox
display data from database in textbox when id entered in textbox  i wanted to enter data in textbox .depending on entered data in textbox data from database should be displayed dynamically in textbox
Advertisements
How to display current date in textbox - Date Calendar
;% } This is my problem: I want to display current date in textbox...How to display current date in textbox  Hi guys, I'm really need your help. This is my source code. var currentTime = new
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' ...: ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' ...: ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo8-addon-hw-customer-display'
ModuleNotFoundError: No module named 'odoo8-addon-hw-customer-display' ...: ModuleNotFoundError: No module named 'odoo8-addon-hw-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-hw-customer-display' error
ModuleNotFoundError: No module named 'odoo9-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo9-addon-pos-customer-display' ...: ModuleNotFoundError: No module named 'odoo9-addon-pos-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' ...: ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo8-addon-pos-customer-display'
ModuleNotFoundError: No module named 'odoo8-addon-pos-customer-display' ...: ModuleNotFoundError: No module named 'odoo8-addon-pos-customer-display' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-pos-customer-display'
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE
HOW TO DISPLAY ID IN TEXTBOX BASED ON COMBOBOX SELECTION IN A SAME PAGE  Dear sir, Am having one table called rolemaster. In that there are 2 fields... is how to get Roleid in textbox when i select Role_name from combobox in a same
For every option selected from a dropdown a new textbox opens
For every option selected from a dropdown a new textbox opens  I have a dropdown with four options, each time I select an option a new text box... the button, everytime a textbox will get displayed. <html> <script>
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I have some problem. I use jsp and ajax. first select: 1 second select:2 based on first value I finished above code. ID: xx Name:xx xx is baesd on second
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.  The code for retrieving data from database into Drop Down List. <% DataSource data = new
how to display each arraylist value on new page in jsp
how to display each arraylist value on new page in jsp  hi!!!! i want to display each arraylist value on new page in jsp????? and also want to access the arraylist values using next button..... any help would be appreciated
Customer Relationship Management
to the customer rather making new customer is the key factor for survival of any business in these time. Also creating new customer and keeping old one with loyal... and their interests and tastes should not be ignored. Creating new customer
ModuleNotFoundError: No module named 'he'
ModuleNotFoundError: No module named 'he'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'he' How to remove the ModuleNotFoundError: No module named 'he' error
retaining textbox values
retaining textbox values  i have a calculator program, when i press a button the value displays but disappears when i press another button so how can i keep values to display when i press multiple buttons
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
How to insert dynamic textbox values into database using Java?
How to insert dynamic textbox values into database using Java?  Hi I am trying to insert dynamic textbox values to database, my jsp form have 2 textboxes...Name, Address with an add button, if you click add button new set
new
new    hi i am jane pls explain the difference between string greeting = good morning string greeting = new string ("good morning
new
new    hi i am jane pls explain the difference between heap memory and stack memory
new
new  hi the difference between string sname = good morning string sname =new("good morning
new
new   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html
customer details
customer details  write a java code to enter n number of persons details(name,address,phone number) in a array list. Also consider exceptional cases like entering integer in name,character in phone number. use try,catch ,throw
ModuleNotFoundError: No module named 'he_update'
ModuleNotFoundError: No module named 'he_update'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'he_update' How to remove the ModuleNotFoundError: No module named 'he
ModuleNotFoundError: No module named 'panoptes-he'
ModuleNotFoundError: No module named 'panoptes-he'  Hi, My Python... 'panoptes-he' How to remove the ModuleNotFoundError: No module named 'panoptes-he' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'nester_he'
ModuleNotFoundError: No module named 'nester_he'  Hi, My Python... 'nester_he' How to remove the ModuleNotFoundError: No module named 'nester_he' error? Thanks   Hi, In your python environment you
having difficulties in dynamically adding textbox with datepicker
add new row of textbox. And also able to use datepicker for the textbox as well. However, I am able to add and display the textbox but not the datepicker. I...having difficulties in dynamically adding textbox with datepicker  hi
Sql Server 2008 with textbox
textbox in a form using vb by visual studio 2010 but its always catch an error... myconn = New SqlConnection("server=localhost;" & "Initial Catalog=4... = "INSERT INTO Table1 (A , B) VALUES ('" + Asd + "','" + Lays + "') " cmd = New
date in textbox on page load
into textbox on page load. <html> <script> function addDate(){ date = new...date in textbox on page load   i want to insret the current date in textbox but this code dosen't work and the value of text box will be blank
showing the information of database in textbox
showing the information of database in textbox  how to make a information of a database make appear to the user in the textbox

Ads