JTextComponent is the base class for swing text components. It tries to be compatible with the java.awt.TextComponent class where it can reasonably do so. Also provided are other services for additional flexibility (beyond the pluggable UI and bean support).
Questions tagged [jtextcomponent]
149 questions
0
votes
2 answers
Font size in Jtextpane looks smaller then in other applications
I have JTextPane and if i write something into it with e.g. font size 12 then it looks smaller than text in e.g. MS Word with same size and same font family.
I've searched on the internet and I found that this is not just my specific problem. But I…

Jan Brzobohatý
- 59
- 6
0
votes
1 answer
How to add JTextArea to JScrollPane?
I am trying to create a simple text editor, and I have run into a problem trying to take my JTextArea and make it scroll-able via a JScrollPane.
The conventional methods I know of have not worked, so I am wondering if anyone here can help. I am…

Nick Clark
- 1,414
- 2
- 16
- 24
0
votes
0 answers
UIError after extending JTextComponent
I got this error after I extended JTextComponent
UIDefaults.getUI() failed: no ComponentUI class for:…

Totalllyrandomguy
- 139
- 2
- 17
0
votes
0 answers
how to make a Custom JTextComponent
I am trying to make a program that requires a couple of custom JTextComponents. For example I need something that acts like a small JTextArea with a different border (not a rectangular one), and some more rules about how to layout the text,…

Totalllyrandomguy
- 139
- 2
- 17
0
votes
1 answer
Splitting StyledDocument
I am currently writing a program that accepts styled text in a JTextPane and also displays the same styled text in a non-editable JTextPane. The problem is that I actually want to parse the documents between inputting and displaying. Basically I…

DonyorM
- 1,760
- 1
- 20
- 34
0
votes
1 answer
Getting Component by name and JTextComponent
I have jTextField named "startTextBox1"
And i use below methods can call it by name;
Creating Hashmap in class.
private HashMap componentMap;
Fill hashmap with components name.
private void createComponentMap() {
componentMap = new…

Black White
- 700
- 3
- 11
- 31
0
votes
1 answer
Tracking document position changes
I am using the Document method createPosition to add Positions to an array. These Positions change depending on the user inserting/removing lines.
How do I hook changes in my array? I need to know the new value and the value which it has changed…

LiquidBacon
- 3
- 2
0
votes
1 answer
Swing insert image via ContentType("text/html");
I have coded the following code:
JDialog helpDialog = new JDialog();
helpDialog.setTitle("Help");
helpDialog.setResizable(false);
helpDialog.setAlwaysOnTop(true);
helpDialog.setSize(393,…

Carol.Kar
- 4,581
- 36
- 131
- 264
0
votes
1 answer
Key typed event not working for the first key typed. java
The following is code block, where i have been trying to validate jFormatedTextFeild. When a key is typed (any key) code block does seem to execute for the first key typed. But works fine for second key typed ! Please help me :(
private void…

dip
- 3,548
- 3
- 24
- 36
0
votes
2 answers
How to display a Set in a Swing JText Label.
I have a Set words that I would like to display in the Swing JTextField/ or JTextArea. Only these components only accept strings. How do I convert this Set into a String?

user3274549
- 71
- 6
0
votes
0 answers
How to make it looking good sentence for line spacing
I develop some project, it works for tagging a words when i drag the words and click special button.
I want to make tags surrounding a word (begin & end tags with red color) (please refer exam picture, this)
but when it tagged at begin & end of…

user1581328
- 19
- 7
0
votes
1 answer
Java popupmenu in Netbean GUI selectall action
Below is my mouse event code for the clicking action. However this action doesnt work for me. How should i change this to work?
private void menuSelectallMouseClicked(java.awt.event.MouseEvent evt) {
…

BeyondProgrammer
- 893
- 2
- 15
- 32
0
votes
1 answer
Java GUI creating objects with arguments taken from text fields
so I have this Jframe where you fill out the text fields and when click "Add" it should create a Car object and send it to the database. But in the listener i keepk getting java.lang.NullPointerException on the textfieldname.getText() even though i…

FancyPants
- 93
- 1
- 4
- 20
0
votes
1 answer
JTextComponent.print(); Prints Blank
I am looking for a solution where text and images are dynamically generated based on user UI content, and then printed on a simple "one click" basis.
My intention thus far (from having done a little research) is to create a JTextComponent who's…

Rudi Kershaw
- 12,332
- 7
- 52
- 77
0
votes
1 answer
Jtable with protected and selectable cell
How to make a JTable cells selectable while they are set non editable.
when i doubkle click at the moment its not selecting the cells. while want it to slecet the cell so that can be copied by contorl c .

user2054151
- 7
- 1
- 12