Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
2 answers
68 views

Component not visible after using "setVisible(true)" on it and its parent

I've got a Java 8 app with a couple of JTextFields and a JButton to log into a database and a JTextArea inside a JScrollPane to display errors. Both the textarea and the scrollpane have to be hidden (...
Neph's user avatar
  • 1,941
0 votes
1 answer
24 views

Java/Swing: How to combine both - fixed size and ability to scroll - for JScrollPane including JTextArea

So I have created a JTextArea (in my case TextArea - to override append and setText methods that include line breaks), to visualise end user what is going on at what time. I have: limited space ...
Traqu's user avatar
  • 11
-1 votes
1 answer
86 views

JScrollPane not scrolling in JTextArea and is staying disabled

I am trying to make a simple text editor using JTextArea, but when I type more text so that it goes off the screen, the JScrollPane is still not enabled and not letting me to scroll. I've looked for ...
Alpha's user avatar
  • 36
-1 votes
2 answers
205 views

How to check for multiple keys at once using keyTyped(event e)

I have the following code: import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax....
Zero's user avatar
  • 94
0 votes
1 answer
190 views

Why is my scrolling textarea in java not scrolling?

I have a frame f, panel Fpanel. and textarea j. This is a part of my code. The scroll does not seem to be working on my text area. JTextArea j=new JTextArea(); j....
abc's user avatar
  • 49
0 votes
1 answer
130 views

Java swing: Add scroll bar to textarea

I have a text area that updates a button press (this updating works fine). When it updates, a long list appears in the text area that requires a scroll bar. However, when I add the last two lines ...
Nicole Ellsworth's user avatar
2 votes
0 answers
149 views

Java swing JTextArea & JScrollPane, vertical scrolling works but not horizontally, one line goes down

I am working on a java gui project. I want to add scoll to JTextArea component. Even though I added it, only Vertical scroll works. That's why the text goes to the bottom line. I do not want this, so ...
MuhammedMGS's user avatar
-2 votes
2 answers
358 views

Prevent JSscrollPane from resizing when adding JTextArea/JTextPane populated with text

Hello people on the internet My problem is that when I call setViewPortView(textArea) on the JScrollPane with the JTextArea already having text in it, the JScrollPane resizes to fit the entire text of ...
Zander Labuschagne's user avatar
-1 votes
1 answer
59 views

JScrollPane doesn't show up

I made a program and I want to add a JScrollPane to a JTextArea (but it doesn't show up). Here's the code (or at least everything that has to deal with the JTextArea / JScrollPane, the whole code is a ...
Mika's user avatar
  • 3
0 votes
1 answer
71 views

Is there a specific way for introducing a 'setText()' JTextArea method when using the NetBeans GUI Builder?

As a school project I've been asked to make a simple text-based RPG in an object-oriented manner and using a GUI. I recently discovered that the NetBeans IDE 12.1 features a helpful GUI builder, which ...
Blank's user avatar
  • 48
0 votes
1 answer
207 views

How do you add both JTextPane and JTextArea to a JScrollPane?

I am trying to make a notepad like application in java. Something like this: I want to have the part on the side with the line numbers (JTextArea) and the text part (JTextPane) and I want to add ...
georgezhang006's user avatar
0 votes
1 answer
258 views

How do I make JTextArea scrollable?

I've been trying to add JScrollBar into a JTextArea, but when I test it the scrollbar does not show up. Also, I want to maximize the text area but it does not become larger even when I change the size ...
tawanprp HD's user avatar
1 vote
1 answer
106 views

Change the selected item

I have a JEditorPane and when I press ctr + space it makes visible a JScrollPane but because the editor pane is still selected is there any way to set the selected Item to be another? (Selected is ...
Holis's user avatar
  • 175
0 votes
1 answer
51 views

JScrollPane don't appear on JTextArea

I have next problem, JScrollPane don't appear on JTextArea and I don't know why? I tried in many ways but nothing, it don't want to show me! I put below a part of the code. All appears correctly, ...
Mitu Gabriel's user avatar
0 votes
1 answer
163 views

How to prevent JScrollPane grow by its JTextArea without make it fixed size?

I'm trying to write an apartment management program with a TabbedPane, I created a class extending JPanel with GroupLayout and added it to my TabbedPane. I have two JTextAreas in this class and I put ...
Atahan Atay's user avatar

15 30 50 per page
1
2 3 4 5
16