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.

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 Tutorials/Questions & Answers:
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
Advertisements
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 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
query - Swing AWT
java swing awt thread query  Hi, I am just looking for a simple example of Java Swing
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
Query on java - Ajax
Query on java  what is modal form
Maven dependency for com.cocosw - query version 0.2.1 is released. Learn to use query version 0.2.1 in Maven based Java projects
- query version 0.2.1 ) in their Java project if it is based on Maven and Gradle...; com.cocosw - query version 0.2.1 in Java projects. Follow the step by step... a new Java project based on maven project management tool if you don't have
Maven dependency for com.cocosw - query version 0.1 is released. Learn to use query version 0.1 in Maven based Java projects
version 0.1 ) in their Java project if it is based on Maven and Gradle. How...; com.cocosw - query version 0.1 in Java projects. Follow the step by step tutorial... and includes  com.cocosw - query version 0.1 java library in your project. ADS
Maven dependency for com.cocosw - query version 0.2 is released. Learn to use query version 0.2 in Maven based Java projects
version 0.2 ) in their Java project if it is based on Maven and Gradle. How...; com.cocosw - query version 0.2 in Java projects. Follow the step by step tutorial... and includes  com.cocosw - query version 0.2 java library in your project. ADS
Maven dependency for com.cocosw - query version 0.2.2 is released. Learn to use query version 0.2.2 in Maven based Java projects
- query version 0.2.2 ) in their Java project if it is based on Maven and Gradle...; com.cocosw - query version 0.2.2 in Java projects. Follow the step by step... a new Java project based on maven project management tool if you don't have
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
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
Maven dependency for cn.jimmyshi - bean-query version 1.1.5 is released. Learn to use bean-query version 1.1.5 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.5 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.5 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.5 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.1.4 is released. Learn to use bean-query version 1.1.4 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.4 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.4 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.4 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.1.3 is released. Learn to use bean-query version 1.1.3 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.3 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.3 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.3 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.1.2 is released. Learn to use bean-query version 1.1.2 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.2 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.2 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.2 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.1.1 is released. Learn to use bean-query version 1.1.1 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.1 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.1 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.1 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.1.0 is released. Learn to use bean-query version 1.1.0 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.1.0 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.1.0 in project? Steps to use  cn.jimmyshi - bean-query version 1.1.0 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.0.1 is released. Learn to use bean-query version 1.0.1 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.0.1 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.0.1 in project? Steps to use  cn.jimmyshi - bean-query version 1.0.1 in Java
Maven dependency for cn.jimmyshi - bean-query version 1.0.0 is released. Learn to use bean-query version 1.0.0 in Maven based Java projects
this version ( cn.jimmyshi - bean-query version 1.0.0 ) in their Java project if it is based on Maven and Gradle. How to use  cn.jimmyshi - bean-query version 1.0.0 in project? Steps to use  cn.jimmyshi - bean-query version 1.0.0 in Java
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 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
Java Query - Java Beginners
Java Query  Q. Write a program to display on command prompt... pass(int number){ int word, q ; if ( number < 10 ){ show ( st1[number...] ) ; } if ( number > 19 ){ word = number % 10 ; if ( word == 0 ){ q = number / 10
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
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
bigdecimal in java query
bigdecimal in java query  Hello, I want to create a boolean method which compares two objects and returns true if equal. At the same time I want this method to compare the values of variables of the same objects and returns true
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
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.58 is released. Learn to use aws-query-protocol version 2.15.58 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.58 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.58 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.61 is released. Learn to use aws-query-protocol version 2.15.61 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.61 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.61 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.64 is released. Learn to use aws-query-protocol version 2.15.64 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.64 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.64 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.67 is released. Learn to use aws-query-protocol version 2.15.67 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.67 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.67 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.70 is released. Learn to use aws-query-protocol version 2.15.70 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.70 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.70 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.73 is released. Learn to use aws-query-protocol version 2.15.73 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.73 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.73 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.76 is released. Learn to use aws-query-protocol version 2.15.76 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.76 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.76 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.79 is released. Learn to use aws-query-protocol version 2.15.79 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.79 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.79 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.15.82 is released. Learn to use aws-query-protocol version 2.15.82 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.15.82 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.15.82 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.2 is released. Learn to use aws-query-protocol version 2.16.2 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.2 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query...-query-protocol version 2.16.2 in Java projects. Follow the step by step tutorial
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.5 is released. Learn to use aws-query-protocol version 2.16.5 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.5 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query...-query-protocol version 2.16.5 in Java projects. Follow the step by step tutorial
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.8 is released. Learn to use aws-query-protocol version 2.16.8 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.8 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query...-query-protocol version 2.16.8 in Java projects. Follow the step by step tutorial
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.11 is released. Learn to use aws-query-protocol version 2.16.11 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.11 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.16.11 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.14 is released. Learn to use aws-query-protocol version 2.16.14 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.14 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.16.14 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.17 is released. Learn to use aws-query-protocol version 2.16.17 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.17 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.16.17 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.20 is released. Learn to use aws-query-protocol version 2.16.20 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.20 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.16.20 in Java projects. Follow the step by step
Maven dependency for software.amazon.awssdk - aws-query-protocol version 2.16.23 is released. Learn to use aws-query-protocol version 2.16.23 in Maven based Java projects
( software.amazon.awssdk - aws-query-protocol version 2.16.23 ) in their Java project if it is based on Maven and Gradle. How to use  software.amazon.awssdk - aws-query... - aws-query-protocol version 2.16.23 in Java projects. Follow the step by step

Ads