Solved

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

Posted on 2001-07-29
5
306 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
Comment Utility
>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
Comment Utility
>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
Comment Utility
what about the answer for maxlength property for a TextField and JtextField ?
0
 
LVL 6

Expert Comment

by:kotan
Comment Utility
Plese refer this on section "Customizing a Document"

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

Author Comment

by:bakyaraj
Comment Utility
is there anyone to help me?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

763 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

8 Experts available now in Live!

Get 1:1 Help Now