Home Answers Viewqa Java-Beginners Java Query(based on swing concept)

 
 


Himalay Sarma
Java Query(based on swing concept)
1 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners

I want a particular submit button to get disabled whenever i write some account number starting with 774 and 775 in a text box of that screen.

View Answers

March 7, 2011 at 5:08 PM


Java swing disable button

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class DisableButton{
    public static void main(String[] args){
    JFrame f=new JFrame();
    JLabel label=new JLabel("Account Number: ");
    final JTextField text=new JTextField(20);
    final JButton b=new JButton("Check");
    text.addKeyListener(new KeyAdapter(){
        public void keyReleased(KeyEvent e){
        String value=text.getText();
        if(value.startsWith("774")||value.startsWith("775")){
            b.setEnabled(false);
            }
            else{
            b.setEnabled(true);
            }
        }
    });

        JPanel p=new JPanel(new GridLayout(2,2));
        p.add(label);
        p.add(text);
        p.add(b);
        f.add(p);
        f.setVisible(true);
        f.pack();
    }
}









Related Pages:
Java Query(based on swing concept)
Java Query(based on swing concept)  I want a particular submit button to get disabled whenever i write some account number starting with 774 and 775 in a text box of that screen
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing application.  Hello Sir, I have a java swing application and i have to execute query based on selection of checkboxes.Means I have to to execute
query - Swing AWT
java swing awt thread query  Hi, I am just looking for a simple example of Java Swing
query
query  what is jre????? why java is robust in nature??????? why it is platform independent???????   Hi, JRE: Java Runtime Environment or JRE is the run time for executing the Java applications. Read more about JRE
query problem
query problem  how write query in jsp based on mysql table field? i have employee table it contain designation field, how write query in jsp... to write this query in jsp please anybody help me, and send me that code
Query
Query  hw to transfer a file from one client machine to another client machine using java socket programming???? plz rpy soon..want to do project
Java + Timer concept - Java Beginners
Java + Timer concept  sir, I am using swing based model. My form... concept.  Hi Friend, Try the following code: import java.awt.... Test() { JFrame frame = new JFrame("Swing Progress Bar"); button
Hibernate Query Language (HQL)
for the names of the Java Classes and properties. Hibernate Query Language is used to execute queries against database. Hibernate automatically generates the sql query...Hibernate Query Language (HQL)  What is Hibernate Query Language (HQL
Query on Java Swing - Table Cell Issue - Swing AWT
Query on Java Swing - Table Cell Issue  Hi, I have a query on Java Swing. we are using swing in our application, In one of the frame we are using JTable which has 6 columns which are editable. When I use the TAB button from
Hibernate Query Language
Hibernate Query Language           Introduction to Hibernate Query Language Hibernate Query Language or HQL for short is extremely powerful query language. HQL
java query
java query  what is the alternative of fflush(stdin) in java
java query
java query  why do we use scanner class
java query
java query  why do we divide the number by 2 in for loop in the prime number program
java query
java query  **strong text**getting an error can not run symbol while running this program..plz help me... import java.util.Scanner; class Great { public static void main(String args[]) { int a; int b; int c; Scanner x
Hibernate Query Language
for the names of the Java Classes and properties. Hibernate Query Language is used... Hibernate Query Language       Hibernate Query Language or HQL for short is extremely powerful
query optimization
query optimization  hai ! i need a code in java for database query optimization.plz help
Hibernate update Query
Hibernate update Query In this tutorial you will learn about an update query in Hibernate This tutorial is based on how to write HQl update query in hibernate. In hibernate update query updates the data of the database table when
HQL query
HQL query  how to select only password based on username using HQL query from login table where uname and paswrd are two column names
sql query
numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
Query on java - Ajax
Query on java  what is modal form
update query
update query  using oops concept in php.. How to update the data from databse ? with program example
Query - Struts
Writing quires in Struts  How to write quires in Java Struts
mysql query
with ("jdbc:odbc:excel"). Execute query "select name, address from [Sheet1$]". Here... database using the loops. For more illustration, we are providing you java example
javascript query
javascript query  how to get javascript variable value into java variable?? i have one value in javascript variable(var name = value ) i want this name variable value in java variable (string name1
query - WebSevices
Creating webservices for Java  What would be the best approach to create web services for Java
project query
project query  I am doing project in java using eclipse..My project is a web related one.In this how to set sms alert using Jsp code. pls help me
Frame query
Frame query  Hi, I am working on Images in java. I have two JFrame displaying same image. We shall call it outerFrame and innerFrame.In innerFrame i am rotating the image.After all the rotations i need to display this image
query on java servlet
query on java servlet  hello sir,i am doing online exam using j2ee (i.e) with servlet and back end ms access just like statically after that i will use dynamic connection sir.what queries to be used for data base validation
Java Query - Java Beginners
Java Query  Q. Write a java program to read the an array's elements(not size fixed of an array) entered by user?  Hi Friend, Try the following code: import java.util.*; class InputArray{ public static void main
Java Query - Java Beginners
Java Query  Q.What is "Identifier Expected Error" in Java and when does it occur? Send me a list of causes related this error.  Hi Friend, This is the error that occurs during the compilation of a resource
query String - Java Beginners
query String  Hi friends, I have some page and given link left side like master,utilities,reports,if i am clicking master then open master file... how i implemmented and write code and send send me, I using query string or any
Java Query - Java Beginners
Java Query  Q. Write a program to display on command prompt as if the user enters 123,it should be display in word like "One Hundred and Twenty Three"?  Hi Friend, Try the following code: import java.util.
Query - Java Beginners
? Parents = UPS UPM UPC UPE and Tutors = UPS and UPC I can't figure out the query for this till now and have been reading up JSTL and Msaccess query etc
java code for given query
java code for given query  i am not able to display to display graph in all browsers it is only displaying in ie using java
Need query for rollup based on month and category
Need query for rollup based on month and category   Hi, Here is my question.. I have a table as below. trans_date,cateory,amount 1-1-11,1,10 2-1-11,2,20 3-2-11,3,15 23-2-11,4,12 13-5-11,4,19 Need a query to get result like
TristateCheckBox based on the Swing JCheckBox - Java Tutorials
TristateCheckBox based on the Swing JCheckBox   2003-12-02 The Java Specialists' Newsletter [Issue 082] - TristateCheckBox based on the Swing JCheckBox... :-) TristateCheckBox based on the Swing JCheckBox I wrote this component
Java image query from Rupesh
Java image query from Rupesh  who give web page link to any submenu in menu bar of screen in java so that after click on that submenu, this submenu direct link to web brower or web page
What is query optimization?
of the best query is important when performance is considered. So you need to sql query tuning based on the requirement. The query optimizer is the component...What is query optimization?  What is query optimization?   
Hibernate Query Language
Hibernate Query Language   Explain Hibernate Query Language(HQL) of Hibernate?   Hi Samar, Hibernate Query Language is a library for mapping relational database to java classes. It is similar in visual aspect to SQL
How to make query and abstraction in Java
How to make query and abstraction in Java  Hi, I read the lessons... write. I am very beginner in Java I don't know anything in it. I am using PostgreSQL database, and I want to make a query and abstraction for a table. Could
Query regarding JSP, JDBC
Query regarding JSP, JDBC  I have a table in SQL Server database... by running a query through the id corresponding the name using arraylist or hashmap in java
retrieving query data
retrieving query data   Blockquote I am new to java or hibernate...... Authentication.java public List<String> domains() { Query query... link: Java Hibernate Tutorials
Frame related query - Java Beginners
Frame related query  hi..... i m having a query dat...can i open a frame inside another frame like dis.. m a new biginner of java n m finding it very intresting. my lines of codes are like dis:- import java.awt.*; import
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <html> <script language="javascript" > function removeAllItems(selectbox
realtime Query - Java Interview Questions
realtime Query  Can you explain any real time bug you faced in java programming
query to fetch the highest record in a table
query to fetch the highest record in a table  Write a query to fetch the highest record in a table, based on a record, say salary field in the empsalary table