I'm using TableLayout for my swing GUI. Initially only some basic labels, buttons and text fields where required which I could later on access by:
public Component getComponent(String componentName) {
return getComponent(componentName, this.frame.getContentPane());
}
private Component getComponent(String componentName, Component co...
I am working on a chat application and I want the user to be able to change their font while typing messages.
I tried using the setFont() method but it changes the font for the entire text within the JTextArea component and when the text is sent to the display area, another JTextArea component, the font changes do not appear. Instead i...
I am using JTextArea in JScrollPane
I want to limit the maximum number of lines possible and the maximum chars in each line.
I need that the string will be exactly like on the screen, each line will end with '\n' (if there another line after it) and the user will be able to insert only X lines and Y chars in each line.
I tried to limit ...
I am to make a cut and a replace method on JTextArea. I have the code for copy and paste, and I reckon I could just use that, in addition to just deleting the marked text in the JTA.
How would the code for a code for cut and replace methods look like?
The code for copy looks like this:
public void copy(){
int start=ta.getSelection...
I have a curious problem with the JTextArea control:
When I bring up my JTextArea everything is fine and whatever I type shows up without delay. However as soon as I send a FontSizeAction to my EditorKit(RTFEditorKit in this case, but it does not seem to matter which I use), a delay, from 1 - several seconds, happens. Interestingly the d...
I have a standalone application in which I have a Jtable. In my table, when I type the text, the height of the Textarea should increase dynamically with the text. How can I do this?
Can someone help me with an example how to do this?
Thanking You
Chaithanya
...
I have embedded a JTextArea on a JScrollPane and am using that JTextArea for output.
I want that whenever the ouput goes beyond the size of the JTextArea, the JTextArea scrolls automatically so that user don't have to do manual scroll down to see the recent output.
How can I do that?
I have already set the autoscroll property of both ...
Anybody know if there is an easy way to limit the allowed characters for a JTextArea. I.e. similar to JTextField using MaskFormatter.
Specifically I want to limit the allowed characters for a JTextArea to only uppercase characters and only a very limited set characters like !"#¤%&/()=
...
Hello,
I would like to everytime I call System.out.println to append to a given JTextArea, without having to change all calls to System.out.println... Is this possible?
Thank you.
...
Hi,
I have a JTextArea in (multiple) JScrollPane in a JTabbedPane.
I need to access the JTextArea. If I didn't have the JScrollPane, I could do:
JTextArea c = (JTextArea)jTabbedPane1.getComponentAt(i);
How would I get it when in a JScrollPane?
Cheers,
Gazler.
...
Hi Geeks,
It seems my current JTextArea instance is having line-spcing about 1 or 1.5. Can anybody tell me how to change the line-spacing in JTextArea instance?
...
So I'm stumped. I, for some reason, seem to remember that Java does weird things when you try to add new lines to stuff... so I think that may be the problem here.
This code is not working how you'd expect it to:
public void displayText(KeyEvent k){
txt = inputArea.getText();
outputArea.setText(txt);
if(k.getKeyCode() == 1...
I had posted a question in regards to this code. I found that JTextArea does not support the binary type data that is loaded.
So my new question is how can I go about detecting the 'bad' file and canceling the file I/O and telling the user that they need to select a new file?
class Open extends SwingWorker<Void, String>
{
File fil...
I have a text area with some text in it and I want to add some lines to it again, (the first lines + the other lines that I want to add) but it doesn't work.
The way I'm doing it right now erases the old text and shows just the new lines.
...
I have a JComboBox named "jComboBox18" and a JTextArea "jTextArea11". Now I want that whenever a item is selected from the "jComboBox18" combo box its corresponding description is shown in the "jTextArea11" textarea.
I have added the appropriate listener to the JComboBox But the JTextArea is not showing any text. The code that I have wr...
Hi all,
I've added a keylistener to my JTextArea field, but it doesn't behave as I expected.
inputTextArea.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent k) {
//If the return button is hit, only set to a new line if shift is also down.
if(k.getKeyChar() == KeyEvent.VK_ENTER) {
if(k.isShiftDown()) {
inputTe...
Hi!,
I'm developing an application which requires that only 165 characters to be in the JTextArea.
I've imposed that condition. I've used a static counter for counting number of characters entered in the textarea and also coded to handle the condition when user deletes any string from the text the counter must be incremented by conside...
Using Netbeans 6.8 (Mac Version) drag and drop tool for making the GUI, I have designed a JTextArea which the user should paste his data which the program will modify and show it to him.
It is working fine; however, when I tried to paste about 65 thousand lines of testing data in the JTextArea, the GUI showed only a few of these lines (...
I would like to increase the spacing / padding / insets for the JTextField and JTextArea. Effectively increase the spacing between the two read line on the image
...
Hi,
I'm developing an application that requires a textarea to be used in which no. of characters are restricted to 165. I made an object of JTextArea with row & column no. 3,3 respectively but it didn't work as when I went on typing, the size of 'Textarea' went on increasing.How to restrict that? As I've used 'DocumentListener' for...