jtextcomponent Questions

3

I made a Java program using Swing libraries. Now I would like to redirect my console outputs into a JFrame or JPanel.
America asked 19/3, 2012 at 19:19

7

Solved

I need to know how to do this: Let's say: I have a code in the JTextArea like this: LOAD R1, 1 DEC R1 STORE M, R1 ADD R4, R1,8 I wanted to change the color of LOAD, DEC, STORE and ADD to color ...
Lettyletup asked 10/3, 2012 at 23:11

1

I've done a ton of research regarding this issue, but I haven't had any luck with anything I've found. It's a major roadblock in the application I'm developing. My application has a Form, which co...
Lammergeier asked 2/3, 2017 at 6:23

1

Solved

I recently have had the need to put several Components, a JTextPane among them, inside of a single JScrollPane's viewport view. (See details here, if interested). I put all the Components (two JPan...
Seismography asked 11/9, 2015 at 1:35

1

Solved

I've implemented a DocumentFilter subclass, and when I type text into the JTextComponent, the replace() method of the filter is invoked, and not insertString() (which is never invoked). Any idea wh...
Burchell asked 7/5, 2014 at 18:25

2

Solved

I want to have a method like this on my DocumentFilter public void replaceUpdate(int offset, int length, String text) { try { super.replace(byPass, offset, length, text, null); } catch (BadLoca...
Marquis asked 19/2, 2012 at 1:13

2

When I try to change color of a JTextArea using textArea.setText("<html> <font color=\"red\"> Hi </font></html>") , the text is shown is basically the whole text written...
Ernesternesta asked 2/11, 2012 at 12:20

5

Solved

I'm currently working on a console window in Swing. It's based on a JTextArea and works like a common command line. You type a command in one line and press enter. In the next line, the output is s...
Universally asked 5/4, 2012 at 14:24

3

Solved

I've been searching for this for a while and so far all I've been able to come up with is how to create a style and apply it to a character like so: StyledDocument doc = (StyledDocument) new Defau...
Breakout asked 25/10, 2012 at 17:57

2

Solved

When my jTextArea is in focus it allows text highlighting, but it doesn't show the text selection when it loses focus. Is it possible to continue displaying the text highlighting even if the user m...
Carter asked 16/8, 2013 at 12:23

2

Solved

It has recently come to my attention that Java text components use line feed characters (LF, \n, 0x0A) to represent and interpret line breaks internally. This came as quite a surprise to me and put...
Kramer asked 26/7, 2013 at 13:26

1

Solved

I’m trying to use OpenDyslexic as a font option in a Swing application. But surprisingly, OpenDyslexic looks much bigger than any other font at the same point size, even though it looks normally si...
Supersensitive asked 16/5, 2013 at 20:3

2

Solved

How to determine number of the first visible line and the number of lines currently visible in scrollable JTextArea (JTextArea inside a JScrollPane)?
Coagulum asked 31/10, 2012 at 18:48

2

I need to create a class derived from JTextComponent (from JTextPane, actually) in which at least one of the default key mappings is changed. That is, in my special JTextPane, I want the ">" keystr...
Locution asked 15/8, 2012 at 16:24

4

I am adding a JTextArea to a component with a layout manager that respects preferred size and location. However, the position of the displayed caret in the JTextArea becomes erroneous after typing ...
Stroboscope asked 5/3, 2012 at 23:58

2

Solved

The main idea is to try and make an application that would have look-and-feel of a standard Linux-type terminal. Now I am limited to Java and here is what I want. Main Window (independent JFrame)...
August asked 25/4, 2012 at 10:19

2

Solved

What are the purposes of using TextAction from AbstractAction? and how to use it for the following: Caret Selection in the JTextComponents KeyBindings
Jumada asked 9/4, 2012 at 15:0

2

Solved

Update: I've found a partial solution in this answer here, by adding the following code: class CustomRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(J...
Weitman asked 6/3, 2012 at 21:9

1

Solved

I am implementing a spellchecker and wondered if there is an easy/obvious way of underlining some text in a different colour such as Red. I have everything set up and underlining with the followi...
Peregrine asked 29/2, 2012 at 16:13

3

Solved

I'm developing an application where I want something to be triggered both by the user updating the contents of a JTextArea, or manually via pressing a JButton. I have done the first part using a D...
Kakapo asked 7/9, 2011 at 1:2

4

Solved

In all the examples that I can find that use a JTextArea, the height & width is known before constructing the JTextArea, and if the JTextArea would require more height, then it is put inside of...
Kenna asked 3/11, 2010 at 0:36

1

I am attempting to implmement smart autoscrolling on a JScrollPane containing a JTextPane. The JTextPane is used for logging my app in color. However I'm running into a wall trying to do smart auto...
Orchestra asked 2/8, 2010 at 22:28
1

© 2022 - 2024 — McMap. All rights reserved.