• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

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

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
bakyaraj
Asked:
bakyaraj
  • 3
  • 2
1 Solution
 
kotanCommented:
>center of the creen

java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
       setLocation((screenSize.width-300)/2,(screenSize.height-200)/2);
0
 
kotanCommented:
>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
 
bakyarajAuthor Commented:
what about the answer for maxlength property for a TextField and JtextField ?
0
 
kotanCommented:
Plese refer this on section "Customizing a Document"

http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
0
 
bakyarajAuthor Commented:
is there anyone to help me?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now