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

All 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 =...
BaRiBoD's user avatar
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: ...
Dilara's user avatar
  • 1
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 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 ...
Obaraten64's user avatar
1 vote
2 answers
151 views

Java Swing trying to add a stationary JButton over a JScrollPane

I am trying to make a text editor with a button that appears at the bottom right of the editor regardless if you scroll up or down and appears over the text area import javax.swing.*; import java.awt.*...
Different's user avatar
-1 votes
2 answers
38 views

My code is not working. How should I add a JScrollPane on a JTextArea that is in a JTabbedPane? [duplicate]

this is the code I have so far public class WindowHelpGui extends JFrame{ JScrollPane scroll; //constructor public WindowHelpGui(){ //add window title super("Help&...
qtdumdum's user avatar
0 votes
1 answer
48 views

Why does the JScrollPane show up but not its scroll bar? [duplicate]

Here is my code. The JScrollpanel shows up but now the scrollbar. I also can't use the scroll wheel if the text goes below the area. JTextArea textArea = new JTextArea("Enter text here"); ...
kozouki's user avatar
0 votes
1 answer
85 views

JLabels not in correct coordinates when in my scroll panel

I was experimenting with scrollable JPanels and I found a problem when placing my JLabels. In the code bellow I tried to have 2 labels in my panel one below another using x and y coordinates. I am not ...
Tyler Lin's user avatar
0 votes
1 answer
56 views

Is there a way to insert multiple JScrollPanes into a JLayeredPane?

In short, I´m trying to make a program that mocks a streaming service interface for an assignment. The program creates two separate JScrollPanes with same specs (size, constraints..), one for movies ...
Bubac's user avatar
  • 13
1 vote
1 answer
161 views

How to position Java swing components when there is a JScrollPane

I am new to making GUIs and Java Swing and I'm trying to make a GUI which displays a table from a SQL database. The table is displayed using a JScrollPane. At first I thought that my other components (...
John Kerry's user avatar
0 votes
0 answers
87 views

JTable with horizontal scrollbar is not working

I am trying to use a JScrollPane with a JTable to display data from the database, but when I create it, the horizontal scrollbar is not being displayed, only the vertical scrollbar is displayed. I ...
Yun's user avatar
  • 1
0 votes
2 answers
694 views

List of Buttons one below other inside JScrollPane

I want to make list of JButtons (with fixed dimensions, one beneath another) inside JScrollPane, using Swing. My idea was to make JPanel with GridBagLayout and add buttons in their suiting rows, and ...
v.st4mb0lic's user avatar
0 votes
1 answer
515 views

How to add scrollbar automatic in jscrollpane?

I try to program a GUI like this. When a button clicked every time a new button is created and placed at specific position but after adding some buttons in jscrollpane, scrollbar not activated, so I ...
Vivekanand Kumar's user avatar
-1 votes
1 answer
44 views

How to scroll resized jframe(GUI Java app)

i'm tired of searching solution for my problem, which is, I have Java swing application, with Jframe,JtabbedPane,and 4 Jpanel's. Frame is set like frmPartsWarehouse.setExtendedState(...
Vsale85's user avatar
0 votes
1 answer
77 views

JTable column titles not showing up even though I have a JScrollPane

I have been trying to make a simple game where a button pops up a window with player leaderboards, but after searching for a while and trying everything, my column titles are now showing up. The code ...
user avatar

15 30 50 per page
1
2 3 4 5
9