java - JTextArea indentation -


i'm having problem jtextarea (not problem though). want create own college program, 1 of function write down , save list of homework each day. it's text area having main function here, type lecturer said. text area act windows original notepad, not keeping indentation. questions are:

  1. how have function press shift+tab key decrease indentation one.

  2. if number 1 possible, how program have behaviour when press enter key, have new line previous indentation? netbeans , other ide.

edited: i'm beginner in java, in truth, i'm making program while studying java in college.

how have function press shift+tab key decrease indentation one.

you need use key bindings listen user typing shift+tab.

if number 1 possible, how program have behavior when press enter key, have new line previous indentation? netbeans , other ide.

use similar piece of logic capture enter key presses. then, check previous line in editor , count number of tab characters preceding text. output similar number @ start of new line.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -