Questions tagged [jscrollpane]
The tag jscrollpane could be used for questions about two topics: 1) a Java Swing component named JScrollPane, 2) a jQuery plugin. Please verify the companion tags to clarify the context of the question.
jscrollpane
2,712
questions
-1
votes
0
answers
32
views
Adding margin to the panel inside a JScrollPane
I have a panel with a BoxLayout layout and I want this panel to have a scrollbar, so I made a JScrollPane. But when I use JScrollPane, the emptyBorder that I add is not added to my panel
JPanel panel =...
1
vote
2
answers
66
views
Java JSCrollPane won't resize below minimum size of JButton with text
I'm trying put a JPanel (GridLayout 0, 1) with JButtons it, within the ViewPort of a JScrollPane. This is easy enough to do, but it doesn't behave "properly" when resizing the parent JFrame....
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 (...
0
votes
1
answer
62
views
Java/Swing: Can't get JScrollPane to show entire element
The goal is to draw a bunch of circles (each a separate JComponent instance) onto a JPanel, and to be able to scroll far enough in any direction to see all of them.
Here is the "main" code:
...
0
votes
2
answers
80
views
Create a list of JCheckBoxes and put them into a JScollPane (UR Robot - URCap)
It has been a while since I programmed with Java Swing, so I'm not an expert with all it's methods. Just to contextualize what I'm doing, I'm building an URCap UI that I'm using in a UR Cobot (That's ...
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
...
0
votes
1
answer
25
views
How to put image in a scroll pane in the upper left
I am displaying an image in a scroll pane and it works great when the pane is smaller than the image. When the pane is larger then the image, the image is centered vertically and left justified ...
0
votes
0
answers
34
views
How to make a FlowLayout JPanel nested inside a ScrollPanel go down the next row when reaching a fixed width [duplicate]
I have a JPanel with a FlowLayout inside of a viewPort of a JScrollPane. I can add components dinamically to this JPanel but when I reach the end of the JScrollPane what i want is for the components ...
0
votes
0
answers
48
views
Zoom to Point with JScrollPane
I found a few questions similar to the one I have, including this and this, but none that really answered the problem, and it's because I am using a JScrollPane. I found the code necessary for the ...
-2
votes
1
answer
54
views
Jscrollpane isn't scrolling
Here's the code I have for my GUI
public class gui extends JFrame{
JFrame mainF;
JPanel listPanel;
JTextArea jtArea;
ButtonGroup buttons;
ButtonGroup restoreButtons;
JRadioButton createButton;
...
0
votes
1
answer
58
views
JScrollPane with GridLayout Panel
I have a JFrame (frame) with a JScrollPane. The JScrollPane contains my ContainerJComponent (DebugPanel). This ContainerJComponent contains JComponentItems (DebugItem). This is an abstracted problem ...
0
votes
1
answer
45
views
Remove MouseWheelEvent/MouseWheelListener awaiting execution in Java Swing
I have an implementation where I want to reload data while scrolling a JList after scrolling every 100 records. I have a large database, and it takes around 7 seconds to load the JList. Therefore, a ...
0
votes
0
answers
38
views
How to implement temporarily disabling AdjustmentListener of JScrollPane in Java Swing
I have a code to load data when scroll is performed. Suppose I scroll, the loadData method is called and is in progress. If during this time I keep scrolling, even though the scrollbar is not moving ...
0
votes
1
answer
161
views
Why are there these weird visual artifacts when scrolling my BufferedImage? And how do I prevent them from happening?
I am creating an application that involves drawing a BufferedImage to a JComponent using Graphics2D in a paintComponent(Graphics) method.
I added the ability to zoom in and out of the image. The ...
1
vote
0
answers
40
views
Why does Document.insertString() auto-scroll with getLength()?
I noticed some interesting behavior with JScrollPane when manipulating the underlying document in a JTextPane. Consider this example:
public class Example {
public static void main(String[] args) ...
0
votes
1
answer
44
views
Java Swing - I don't know why my JScrollPane wont scroll down
I have some issues making a JScrollPane scrolling in Swing. I don't know why it is doing that.
It worked before when I just created a pane on top of the contentPane. But it is not working anymore now ...
1
vote
0
answers
99
views
Zoom to Mouse Pointer using AffineTransform and JScrollPane
my goal is to implement an image viewer, where one can zoom to the mouse position and the JScrollPane correctly response to this zoom gesture. Also the possibility to roate the image would be nice.
I'...
0
votes
0
answers
45
views
How to create a Scrolling Pane for a Chat System?
I've already created a working scrolling pane using JScrollPane, however, the current code works as follows: I type something into the chat input, press enter, it creates a JPanel and adds it to the ...
0
votes
0
answers
20
views
adding Commonest to jPanel with gridLayout
so I am making a program to study and I want to see and edit the words that you upload in a Jscrollpane and I have a JPanel with gridlayout(0,2) in the Jscrollpane (with maximum height of 700) and ...
1
vote
3
answers
74
views
adding a non-scrolling component to a JScrollPane
I'd like to add a non-scrolling element, always visible element (a "pinned" element) in a JScrollPane of a Swing GUI. Taking this example code:
public class Main {
public static void ...
0
votes
1
answer
55
views
JPanel.getHeight() doesn't exactly work as intended
So I have a program that utilizes JFrame and JPanel and such. I have multiple JPanels with JTextAreas within them, like a list. I'm trying to create JScrollPane that allows me to scroll through all ...
0
votes
0
answers
41
views
Placeholder image in JViewport of JScrollPane for empty JTable
I have a JTable and want my user to drag&drop entries into that JTable.
To make that as obvious as possible, I want to display a placeholder image like "Please drag stuff HERE using your ...
0
votes
1
answer
34
views
How do I adjust the width of a JScrollPane based on the width of JTable Data?
My Java program has a JTable in a JScrollPane. For the table I set setAutoResizeMode(JTable.AUTO_RESIZE_OFF) and I adjust the column widths to match the data using resizeColumnWidth (shown in many ...
1
vote
0
answers
31
views
Unable to add components on a new line in this JPanel
I'd like to create in Java Swing a file manager-alike interface, with icons spanning horizontally unless no more horizontal space is possible to allocate, and then going to a new line.
This is my ...
1
vote
1
answer
86
views
JList - Horizontal list, visible amount of values
I'm trying to create a horizontal JList with seven items inside a JScrollPane and only three of those items need to be visible and the others accessible via a scrollbar. Here's an example of what I'm ...
0
votes
1
answer
43
views
JScrollPane doest not act correctly when image is resized
I searched and found tons of questions here about my problem, but it seems I cannot implement correctly the solutions I found.
I have a JScrollPane in which I put a custom JPanel.
This custom JPanel ...
0
votes
1
answer
57
views
How to add and remove scrollbars dynamically to a zoomable panel based on Rectangle's visibility
I am trying to manipulate some blue rectangles within a confined, much larger red rectangle.
I have this working along with a zoom-in and zoom-out function
The problem is I would like to display ...
0
votes
1
answer
83
views
How do i wrap text of a single JLabel in JScrollPane instead of horizontal scrolling without using JTextArea
(to note im new to programming so this may be a simple answer or my code is just written wrong) I have a larger program with a string that is constantly being appended and trimmed. Its written with ...
-1
votes
1
answer
48
views
JTable is only showing the first column of imported data. How do I show all columns?
I'm building a table of imported values from a csv sheet. I have 95 rows and 26 columns. I want to display all of the "dataS" values in my JTable, but I'm only getting the first column.
Is ...
0
votes
1
answer
90
views
Why am I not getting scroll-bars with MigLayout manager?
I'm writing a desktop application.
The environment is following:
Java SE 10
Eclipse IDE
Java Swing
MigLayout
The source-code, the important parts.
textPane = new JTextPane();
textPane....