Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
91 views

I am using the middle mouse button for an autoscroller in a Java Swing application. However, when I middle-click on a text component, on Linux it pastes the last selected text, which is unwanted. How ...
Boann's user avatar
  • 50.3k
-1 votes
2 answers
104 views

I want to add text color while print output. How to do that ? Example: Print('Hello Everyone.') I want output text Hello Everyone will highlighted red color. Thanks you!
trunghai's user avatar
0 votes
0 answers
52 views

I must do project for studies (homework) where We upgrade utilities. One my feature is "coloring text". I never did It, but I have small idea. I want to bind for example $0 to $9 with colors: BLUE,...
user avatar
1 vote
2 answers
2k views

I have set some text in JTextArea. The cursor is in the 5th line. Now I want to set some text in the first line. So is it possible to re-position the cursor to the desired line?
Anukool's user avatar
  • 832
0 votes
1 answer
317 views

I m using the the focus event listener to implement a placeholder solution for all JTextComponents (JTextField, JTextArea ...) my implementation is as below public class PlaceHolderDecorator { ...
Mohammed Housseyn Taleb's user avatar
-2 votes
1 answer
61 views

I'm trying to have to jtextcompontes with one scrollbar. when I scroll I want the other jtextcomponte to scroll too. Here's a screenshot:
SSM's user avatar
  • 409
0 votes
1 answer
31 views

I've connected Vladimir Petrenko's screen keyboard (1.0) to my apps JTextComponent and it works well. Alas, the hardware keyboard continues to provide input characters and I'd like to have the ONLY ...
user3594510's user avatar
2 votes
1 answer
1k views

Alright, I do not know how to fix this and only ran into this problem after trying to put in some longer text on a UI Text component. I have tried both pasting a value into its Text attribute through ...
blue's user avatar
  • 7,413
-4 votes
1 answer
52 views

Main reason for exception message is display only one line but my exception message is contains more than 4 lines. How can i resize my text box?
Sriman Java's user avatar
0 votes
1 answer
1k views

I have two text files which I'm trying to compare, i.e., find matching words and highlight the matching words. The code below takes the two files, finds matching words and prints them out: public ...
Love's user avatar
  • 43
0 votes
1 answer
295 views

So Swing text components provide a way to ahve global keyboard shorcuts. JTextComponent.getKeyMap(JTextComponent.DEFAULT_KEYMAP) provides a way to modify the global, default keymap inherited by all ...
craigmiller160's user avatar
0 votes
2 answers
91 views

I am using JtextPane as a JTextField to make use of Html for styling..but I cant implement prompt text functionality..here is my code... JTextPane txtNm = new JTextPane(); txtNm....
Sayantan Chandra's user avatar
1 vote
2 answers
900 views

I have a panel null layout and have the following code int k=130; int h=10; for (int i=0; i<22; ++i) { jTextFieldArray[i] = new JTextField(); jTextFieldArray[i].setBounds(k, h, 120, 25); ...
Wesam's user avatar
  • 23
0 votes
1 answer
4k views

I want to access JTextField of a class from another class , From the new class i want to setText to the textField. from class patient_details i want to access the JTextField present in class ...
dheena's user avatar
  • 85
0 votes
1 answer
1k views

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, ...
Nick Clark's user avatar
  • 1,446
0 votes
0 answers
21 views

I got this error after I extended JTextComponent UIDefaults.getUI() failed: no ComponentUI class for: com.mypackage.components.FlowComponent[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,...
Totalllyrandomguy's user avatar
0 votes
1 answer
178 views

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 ...
DonyorM's user avatar
  • 1,810
0 votes
1 answer
216 views

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 ...
Black White's user avatar
0 votes
1 answer
673 views

I have coded the following code: JDialog helpDialog = new JDialog(); helpDialog.setTitle("Help"); helpDialog.setResizable(false); helpDialog.setAlwaysOnTop(true); helpDialog.setSize(393, 43); help....
Carol.Kar's user avatar
  • 5,261
5 votes
1 answer
757 views

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 why ...
Aviv Cohn's user avatar
  • 17.5k
1 vote
1 answer
72 views

I am making a paint program and I'm coming across some trouble figuring out how to make a text tool. What I want to do is click and drag to make a textbox appear on the canvas. The problem is that I ...
pigi5's user avatar
  • 94
1 vote
1 answer
2k views

i am trying to trigger key released event in java swing. txtEmailId.addKeyListener(new KeyAdapter() { // override keyReleased listener on the Email TextField @Override ...
Uday A. Navapara's user avatar
0 votes
2 answers
313 views

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's user avatar
1 vote
1 answer
69 views

im stuck on a simple question, i want to display formatted text in a swing control and keep on adding new values into it, i don't want to use .setText(.getText + text) for personal reasons, (something ...
Ajinkya Jumbad's user avatar
2 votes
1 answer
475 views

Background: I am using custom AWT D&D in my (heavily) customized JTextPane subclass. In other words, I have disabled Swing's D&D with pane.setDragEnabled(false) and I use my own DragSource, ...
BrianY's user avatar
  • 325