Solved

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

Posted on 2001-07-29
5
316 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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.

861 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