How to get JTextArea restricted

Hi All,
Can anybody help me out for this one. its urgent.
I've used a JTextarea in my project. I want that user should get restricted to type just 60 characters in a line and can type only 36 lines of text in that. he must get a msg Box if he tries to type more than the one specified and should not be able to type.
Thanks in advance,
New_logical_developer

In the future, Swing related questions should be posted in the Swing forum.
Each criteria on its own is easy to implement. However combining the two is where it gets difficult and I don't have a solution.
For example what happens if you have two line of 45 characters each and then the use tries to remove the new line character between the two lines. Now the total line lenght would be 90 characters which is invalid. So do you prevent the user from removing the end of line character or do you manually split the lines into one of 60 and the other of 30?
Also what happens if you have 50 characters of text and the user tries to paste some text containing 30 characters. Do you ignore the last 20 characters or manually create a new line with the 20 characters.
Or maybe your requirement is that you want the lines to "wrap" at 60 characters so you don't have a physical new line character in the file.
So basically we can't really help since you requrement is not a simple as you think.
However, the general solution would probable be to use a DocumentFilter, which is explained in the Swing tutorial on "Text Component Features":
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter

Similar Messages

  • How to get the restriction pass code for iPhone ?

    How to get the restriction pass code for iPhone ?

    if you forgot it you have to restore your phone to get past that code

  • How to get the restriction pass code for my iPad

    How to get restriction pas score for my ipad

    Remove restriction passcode
    1. Restore to Factory Default
    http://support.apple.com/kb/HT1414
    2. You can restore from a backup that was done before you enable the Restriction Code.

  • How to get my Restrictions Passcode

    I Need to get rid of the stuff on my iPod 5 and I forgot my Restrictions Passcode, how do I get it back?

    Forgotten RESTRICTIONS Passcode
    - Place the iOS device in Recovery Mode and restore via iTunes. For how to restore: iTunes: Restoring iOS software
    You have to either:
    - Restore from a backup that was make before you added the Restrictions passcode. If you restore from a backup made with the Restrictions passcode the Restrictions passcode is also restored.
    - Restore to factory settings/new iPod

  • HT1904 how we get my restrictions password if i forget it

    I have forget my restrictions password. So,I want to do it recover but How ? I can not take any ideas.Therefore please suggest me for that.

    If you can't remember the restrictions code then was it on the phone when you last backed up ? If not then you can restore to that backup and it should be removed. If it was on the phone when you last backed up then the only way to remove it is to reset the phone back to factory defaults and you can then re-sync your content back to the phone - you won't be able to restore to the backup as that will keep the code in place.

  • I forgot the passcode to turn off restrictions. I have restored my iPad back to the factory settings and then synced it with the latest backup. The restrictions are still on and it is asking for the passcode. Can someone tell me how to get that off.

    I forgot the passcode to turn off restrictions. I have restored my iPad back to the factory settings and then synced it with the latest backup. The restrictions are still on and it is asking for the passcode. Can someone tell me how to get that off.

    The only option is to wipe the device clean and restore it to factory settings.  Hope you have a backup.
    Follow the instructions in  iOS: How to back up your data and set up your device as a new device http://support.apple.com/kb/HT4137 to restore the device to factory settings.
    Once you have setup the device as a new one, you can then sync it back with your iTunes account and all your music, apps, contacts and any other content sync'ed with iTunes will be loaded on the device. Any content that is stored only on the device and not sync'ed with iTunes, like app logins or data, will be lost during this process. Be forewarned that this is a long process and can take a couple of hours or more to complete. This can be painful, but it is necessarily so to prevent users from working around the security settings. After the restore is complete, you can setup a new Restrictions passcode. Make a note of the passcode to avoid this situation in future.
     Cheers, Tom

  • How to get the text present in JTextArea

    i am writing application for some system to be computerised and i am not getting how to get the text present in text area and set it into database...can anybody suggest me solution??

    You must have named the TextArea like
    JTextArea textArea;so, use the getText() method like
    String strTextAreaContents = textArea.getText();You can then use JDBC to connect to the database that you want and save your contents that is now in strTextAreaContents.
    -- Srikanth

  • How to get the content of a jTextArea?

    hi everyone
    can some body provide me with some help???
    I want to know how to get the content of a jTextArea
    it may be a String and i want to use that String to make some applications
    I've use this :
    String ch=jTextArea.getSelectedText()
    but i'm not sure it will work and i'm not sure it will take the text writen inside the jTextArea ... please help
    Thanks

    http://forum.java.sun.com/thread.jspa?threadID=778988&tstart=0

  • How to i get (forgot) Restriction passcode

    How to i get (forgot) Restriction passcode

    You will need to try to restore your iDevice from the same computer that you most recently synced to.
    Read this: http://support.apple.com/kb/ht1212
    If you can't do the restore then you will need to try Recovery Mode.
    Read this: http://support.apple.com/kb/ht1808

  • How to get Text from (.txt) file to display in the JTextArea ?

    How to get Text from (.txt) file to display in the JTextArea ?
    is there any code please tell me i am begginer and trying to get data from a text file to display in the JTextArea /... please help...

    public static void readText() {
      try {
        File testFile = new File(WorkingDirectory + "ctrlFile.txt");
        if (testFile.exists()){
          BufferedReader br = new BufferedReader(new FileReader("ctrlFile.txt"));
          String s = br.readLine();
          while (s != null)  {
            System.out.println(s);
            s = br.readLine();
          br.close();
      catch (IOException ex){ex.printStackTrace();}
    }rykk

  • How do i get my restriction passcode ?

    How do i get my restriction passcode ?

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.

  • How do I get around restriction of 5 devices to I Tunes account?

    IHim the process of purchasing iPhone 5s from my mobile provider. As I already own several apple products how do I get around restriction of five devices to I Tunes account?

    Welcome to the Apple Community.
    There are no way around restrictions.
    However the restriction of 5 is for computers only, you can have up to 10 associated devices which include mobile devices and computers (up to 5 of course)

  • How do I get the "Restriction" off my phone when I call  so they know it is me calling?

    How do I get the "Restriction" off my phone when I call  so they know it is me calling?

    Here you go.   http://m-support.verizonwireless.com/clc/devices/knowledge_base.html?id=20203   http://support.verizonwireless.com/faqs/Features%20and%20Optional%20Services/faq_caller_id_block.html

  • How do I get the restriction pass code off ? I have forgotten the code.

    How do I get the restriction pass code off ? I have forgotten the code.

    I think you mean a restore to factory defaults/new iPad. See:
    iTunes: Backing up, updating, and restoring iOS software

  • How to get restriction code

    How to get restriction code

    What do you mean?
    The restriction code would be whatever you set it to be.
    There is no restriction codeunless you set it.

Maybe you are looking for

  • Missing episodes - Nikita (Warner TV)

    Missing episodes - Nikita (Warner TV) - should be 22 episodes in series 1, only 14 listed? Solved! Go to Solution.

  • ERROR with PORTAL Installation 10.1.0.2 on XP

    include "C:\product\10.1.2\OracleAS\infra\Apache\Apache\conf\mod_oc4j.conf" include "C:\product\10.1.2\OracleAS\infra\Apache\Apache\conf\dms.conf" LoadModule rewrite_module modules/ApacheModuleRewrite.dll include "C:\product\10.1.2\OracleAS\infra\Apa

  • Why my iPhone5C is getting Hang after updating to iOS8?

    After updating to iOS8 my iPhone5C is getting Hang Frequently once or twice a day. Please fix this problem releasing stable OS. Not only I am having same problem some of my friends having iPhone5C and 5S are also having same. Please release iOS8.0.1

  • Possible to replicate new fields?

    Hi, I am running Oracle 8i v8.1.7 std edtion server on Windows 2000 server and have handheld computers running Oracle 8i Lite. I've got replication working well, but I was wondering if there is a way to replicate newly added fields (added on the serv

  • Pages: Auto rotation works in iPad - not in iPhone ...

    I have both iPad and iPhone. I work with documents and spreadsheets, sometimes from my iPad, with PAGES & NUMBERS Everything works fine, when I turn my iPad my documents and spreadsheets turn as well, so I have a landscape view. When I do the same fr