public class TextFieldBorderColor extends JFrame{ JTextField text1,text2; JLabel label1,label2; JPanel panel; JButton b; public TextFieldBorderColor(){ label1=new JLabel("Enter Name"); text1=new JTextField(10); b=new JButton("Submit"); panel=new JPanel(new GridLayout(2,2)); panel.add(label1); panel.add(text1); panel.add(b); b.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ String value1=text1.getText(); Pattern p = Pattern.compile("[0-9]"); Matcher m = p.matcher(value1); if (m.find()) { text1.setBorder(BorderFactory.createLineBorder(Color.red)); } } }); add(panel); setVisible(true); pack(); } public static void main(String[] args) { TextFieldBorderColor color=new TextFieldBorderColor(); } } Thanks
Related Pages:
set text field appearance to default - Java Beginners settextfieldappearance to default hi, i am doing a program... color of a text box if the input was incorrect, but when i fail to set... is wrong, i set the border to red, if not, i want to leave it default, but i cant
JButton Appearance
Java: JButton Appearance
You don't have to do anything special with a button, but there
are many methods for changing the appearance. You can change the alignment
of the text and icon, set the font, have
iPhone Text Field Border TextField Boarder
In this tutorial will learn about the textfield Boarder, we can set the boarder of textfield by selecting the textfield... field and will set create a variable for the textfield, after creating
Text field save as word file Textfield save as word file Dear experts At run how to save set of textfield contains text into single Word file. To save in our desktop computer. Solve my problem
is set interface synchronize by default???????
is set interface synchronize by default??????? is set interface synchronize by default???????
an whether list is syncrhronized by default
focus text field - Swing AWT
focus text field i want to move cursor to next textfield...(java.awt.event.KeyEvent evt) {
Set..._TRAVERSAL_KEYS);
Set newForwardKeys = new HashSet(forwardKeys
focus text field - Swing AWT
focus text field i want to move cursor to next textfield...(java.awt.event.KeyEvent evt) {
Set..._TRAVERSAL_KEYS);
Set newForwardKeys = new HashSet(forwardKeys
text field text field How to retrieve data from textfield
Hi Friend,
Try the following code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class RetrieveDataFromTextFields{
public static void main
retrive record from the text field and insert into to database
retrive record from the textfield and insert into to database  ... ServletException,IOException{
response.setContentType("text/html... =new ArrayList();
String query = "insert into LTCINFO.PERSONS set
SQL Alter Column Default Value
)) and set the default value for this
field is set '10'.Whenever you leave a blank value in Stu_Id, This field
would take default value of '10... is used with Create
Table Statement. The default value will be set as per
Java Password Field
of
textfield which allows to enter password only. Due to the security reason... the wrong entry in either of the textfield or
password field and then if you...Java Password Field
In this section we will discuss how to use password field
converting field to text sql
converting field to text sql I wanted to convert the field to TEXT in SQL.. is it possible?
SQL - Converting the field to TEXT works... the field to TEXT works
SELECT CONVERT(TEXT,fld_name) FROM TABLE_NAME
jsf text field not blank
jsf textfield not blank textfield not clear in jsf onclick of reset button in my application initial value not deleted
Hello Friend,
Post your code.
Thanks
validate text field iPhone
validate textfield iPhone i got two different UITextfield in my iPhone application for user login. Just wondering how to validate
CALULATION IN TEXT FIELD
CALULATION IN TEXT FIELD Suppose 3 textField first amount ,second amount and third sum of these amount,this amount will appear when tab in next filed(i don't want use any type button) in java swing HOW? PLEASE HELP
Mysql Alter Column Default
' and add column to
setdefault:
The Query Alter is used to modify table 'usertable...
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra...
Mysql Alter Column Default
 
pdf default size
pdf default size
In this program we are going to tell you how we can
automatically set the default size of pdf.
Its options are from A0 to A10. These text explains the ISO
Digit Only text field
Digit Only text field How should we accept digits only in a textbox?
(using JSTL only, without Javascript
clearing text field in spring form
clearing textfield in spring form hi,
I have spring form in that i have security question dropdown field and security answer textfield ,when i submitted form with errors the answers textfield value should be clear, for this i
SQL Alter Column Default Value
)) and set the default value for this
field is set '10'.Whenever you leave... with Create
Table Statement. The default value will be set as per specified...
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
date_default_timezone_set
date_default_timezone_set
date_default_timezone_set function sets...
bool date_default_timezone_set ( string $timezone_identifier )
It is notable that default timezone can also be set by using INI setting date.timezone.
rich text field - JSP-Servlet
rich text field Hi, this is jawahar. my question i need rich textfield in my program . plz send me the code
Java Set Default Locale
Java SetDefault Locale
Setting Default Locale Example in Java
Locale can be set also.... In this example we have set the
default locale value of our Locale with the Locale.ITALY.
Showing the Frame with Default Look and Feel
the
frame in the default look and feel. Displayed frame has a combo box and a text box,
the text box text is changed as per your selection in the combo box.
Screen...
Showing the Frame with Default Look and Feel
 
text field validation - Java Beginners textfield validation hi
How to validate allow only decimal number in text box
in jsp? Hi Friend,
Try the following code:
function isDecimal(str){
if(isNaN(str) || str.indexOf(".")<0){
alert
iPhone Input Field, iPhone Input Field Tutorial
the users. In iPhone application we can use TextField to take the input. Textfield displays editable text and once you taps it'll display a keyboard.... And now place labels and TextField according to your requirement. I have taken
Set TextField Appearance in java Swing Set TextField Appearance in java Swing
In this section, we are going to change the border color of the textbox. For this purpose, we have allowed the user..., the color of the textbox border will changed to red. To set the border color, we have
Text Field in HTML TextField in HTML
The TextField in HTML are one line areas, which enable the user... TextField in HTML.In this Tutorial, the
code create a textfield in HTML page
Setting the default Locale
;
This section shows you how to set the default locale.
Example presented in the section, illustrates you how to
get and set the default
locale. ... as a parameter for the method to set it as a default locale.
Here is the code
Mysql Time Field
,
`time_field` time default NULL,
PRIMARY...
Mysql Time Field
Mysql TimeField Query is performed when you want to return the time
field
ipad default image names
ipad default image names i have a problem while launching application in iPad. The Default image that i have set is not displaying in landscape mode correctly. please suggest.
Thanks.
ipad Default image names
JSP combo and text field related questio
JSP combo and textfield related questio in JSP,i had stored data from database in a textboxes usin combo..now i want to use these values of text... and name given to that textfield..but its showing somethimng null pointer exception
How to Define Text Field Validation iPhone
How to Define TextField Validation iPhone Hi,
Can anybody explain me how to define textfield validation iPhone program. please phone online help reference or example.
Thanks
To make toggle by default hidden
To make toggle by default hidden i have done this coding in javascript.
<script type="text/javascript">
$(document).ready(function...;a href='#' id="pw1">Comments</a>
<p id=1></p>
by default
iPhone Text Field Validation
iPhone TextField Validation
In any user based application "... data from user. In this tutorial we are going to limiting the textfield input...;. We have also take a Textfield on the view to take the input from user
Browse Button Enlarge Field - Development process
Browse Button Enlarge Field How can I enlarge the browse textfield... of the path is visible in the text box unless you press the end buton on the keyboard to view the remainder of the path. I want to enlarge the field so I can see more
fetch values from database into text field
fetch values from database into text field please provide the example for fetching values from database into textfield of table
wth edit...;/td>");
the i am getting "rs.getString" in the textfield also..  
fetch values from database into text field
fetch values from database into text field please provide the example for fetching values from database into textfield of table
as if i am... "rs.getString" in the textfield also.. import java.awt.*;
import
Set text color in JoptionPane Settext color in JoptionPane
In this section, you will learn how to settext... is responsible for look and feel. Using following key value pair, we have set the text...("Panel.background", Color.yellow);
JOptionPane.showMessageDialog(null,"Hello","Set Color
Unique field
Unique field I have created a form where I have a textbox and a button. When I write something in the textbox and click on submit,it should go to database but at the same time, it should give an alert if the text entered
Use of Text Field
Use of TextField, Text box, Text Area, Checkbox,Dropdownlist and Radio... types
of information. A form contains form elements checkbox, textfield, radio...;/form>
Text Fields:
Text fields are used to allow
Text Field Midlet Example TextField MIDlet Example
This example illustrates how to insert textfield in your form... the form with name and company field. The
TextField
SET Syntax
or ROLLBACK for
canceling it. By default it is set to 1. Example :
 ..._LOG_BIN = {0 | 1}
Its default value is 1 but if it is set to 1...}
Its default value is 0 but if it set to 1 then no logging is done
Password Field in HTML
displays
asterisks or bullets instead of the characters. Password textfield is same as
textfield. The only difference between them is that when a user entered... illustrates a username and password textfield.
<form action> :The page