Solved

How will you set the maxlength for a TextField or JtextField?

Posted on 2001-07-29
5
310 Views
Last Modified: 2011-10-03
Hi Guys,

I have a doubt regarding the TextField and JTextField.
Is it possible to set the maxlength property for a TextField and JtextField ?, If possible, how will u do that? please reply immediately.
     Also , how will you align the Frame and JFrame to the center of the screen. (Don't say we can use setBounds and move methods).

Regards,
Bakyaraj.
0
Comment
Question by:bakyaraj
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 6333137
>center of the creen

java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
       setLocation((screenSize.width-300)/2,(screenSize.height-200)/2);
0
 
LVL 6

Accepted Solution

by:
kotan earned 50 total points
ID: 6333139
>center of the screen

java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setSize(new java.awt.Dimension(300, 200));
        setLocation((screenSize.width-300)/2,(screenSize.height-200)/2);
0
 

Author Comment

by:bakyaraj
ID: 6333165
what about the answer for maxlength property for a TextField and JtextField ?
0
 
LVL 6

Expert Comment

by:kotan
ID: 6333207
Plese refer this on section "Customizing a Document"

http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
0
 

Author Comment

by:bakyaraj
ID: 6336750
is there anyone to help me?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now