jscrollpane

JScrollPane now showing its viewport

那年仲夏 提交于 2019-12-24 12:17:48
问题 I am making an application with Java Swing and i have a problem. I have made a Tabbed Panel, which need to hold a simple panel, and a scroll-panel. The simple panel is working fine but in my scroll-panel i can only see the scrollbars, but not the viewport, my code is as follows: ContentPane public class ContentPane extends JTabbedPane { private InfoPanel ip; ScrollPanel sp; public InfoPanel getIp() { return ip; } public ContentPane(GraphPanel gp) { this.sp = new ScrollPanel(gp); this.sp

How to make JTextPane wrapped in JScrollPane shrink to fit the text

柔情痞子 提交于 2019-12-24 10:29:00
问题 I have a JTextPane with HTML text. I used GroupLayout (using WindowBuilder). I've set the minimum size of my JFrame to 800x600 so the user cannot make it smaller than that. The app has a big scrolling JPanel the size of the entire window. The top part of the panel is taken up by a JTextPane wrapped in JScrollPane . I have disabled the scroll bars and sized the JScrollPane to make the entire text visible. In group layout the JScrollPane is set to stay constant vertically, but size horizontally

JScrollPane setHorizontalScrollBarPolicy as_needed without resizing content

白昼怎懂夜的黑 提交于 2019-12-24 06:24:09
问题 I noticed an issue with the setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED) resizes the height content when the scrollbar gets added (due to the content going over the width). The Code... import javax.swing.*; import javax.swing.border.Border; import java.awt.*; public class TestGui extends JFrame { //************************************************************************************** //************************************* Constructor **********************

JTable with a ScrollPane misbehaving

家住魔仙堡 提交于 2019-12-24 05:04:12
问题 I have a JPanel component with a JTable inside of it. When I run the code as it's written below, the table renders and updates correctly. As soon as I try to use the scrollPane approach, the table does not render at all. Can anyone explain to me why this is? private static class GameHistoryPanel extends JPanel { private DataModel model; private JTable table; private int currentRow; private int currentColumn; private final Dimension HISTORY_PANEL_DIMENSION = new Dimension(190,460); public

JTable with a ScrollPane misbehaving

假装没事ソ 提交于 2019-12-24 05:04:11
问题 I have a JPanel component with a JTable inside of it. When I run the code as it's written below, the table renders and updates correctly. As soon as I try to use the scrollPane approach, the table does not render at all. Can anyone explain to me why this is? private static class GameHistoryPanel extends JPanel { private DataModel model; private JTable table; private int currentRow; private int currentColumn; private final Dimension HISTORY_PANEL_DIMENSION = new Dimension(190,460); public

Auto loop-scrolling active contents in JPanel - marquee text

蹲街弑〆低调 提交于 2019-12-24 03:26:32
问题 I need some auto loop-scrolling (marquee text) it's contents JPanel . It contents must react on mouse clicking on different elements. So just drawing contents with moved coordinates not working here, because real position of elements not changing. Also it must be update able. Most likely that it will be smooth update - without any bouncing. Tried to use JScrollPane with no visible scrollers and auto-scrolling, it can hold action listeners, but I can't make it smooth looping and smooth

A Java Scroll Indicator with floating scrollbars which only appears during scrolling

倖福魔咒の 提交于 2019-12-24 02:53:04
问题 I need a scroll pane with scrollbars only visible during scroll events or when needed to pull. Something that looks like the scroll bars on the nowadays smartphones. I searched a lot but found only realizations in javascript. So I tried it by myself. Has anyone a better solution or hints? The animation classes can be found here: TimingFrameWork import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics import java.awt.Rectangle; import java.awt

A Java Scroll Indicator with floating scrollbars which only appears during scrolling

拟墨画扇 提交于 2019-12-24 02:51:22
问题 I need a scroll pane with scrollbars only visible during scroll events or when needed to pull. Something that looks like the scroll bars on the nowadays smartphones. I searched a lot but found only realizations in javascript. So I tried it by myself. Has anyone a better solution or hints? The animation classes can be found here: TimingFrameWork import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics import java.awt.Rectangle; import java.awt

location and size of jtextarea in jscrollpane is not set

蓝咒 提交于 2019-12-24 00:56:38
问题 I am working on the editor. I am using Java swing for it. I have embedded a JTextArea with JScrollPane . i want to position the jtextarea of particular size at the middle of JScrollPane . To do this I used setLocation function. But this is not working? public class ScrollPaneTest extends JFrame { private Container myCP; private JTextArea resultsTA; private JScrollPane scrollPane; private JPanel jpanel; public ScrollPaneTest() { resultsTA = new JTextArea(50,50); resultsTA.setLocation(100,100);

Call knockout viewmodel function in jQuery

こ雲淡風輕ζ 提交于 2019-12-24 00:47:35
问题 How to call a viewmodel function in a jQuery function? I just want to call a function of viewmodel function from a Javascript function. function ContactsViewModel(data) { var self = this; // Editable data self.Contacts = ko.observableArray(JSON.parse(data)); self.limit = ko.observable(20); self.changeNumber = function(item){ self.limit(self.limit()+20); self.Contacts.push(item); } self.myPostProcessingLogic = function(elements) { if ($('#KnockOutContacts').children().length === ko.toJS(self