jscrollpane

jScrollPane and AJAX

ε祈祈猫儿з 提交于 2019-12-23 17:41:16
问题 I'm trying to load some data via an AJAX call to a PHP script and then returning it, bla bla bla. Well, it works all fine till jScrollPane won't reload on the AJAX call. I simply don't understand why, since I've called it in the success part of the $.ajax call... But oh well, dunno. Have a look at the code below and tell me what I'm doing wrong/how to fix it. function eventLink(){ jQuery(".ticket-link a").fancybox({ width:710, height:750, type:"iframe", transitionIn:"elastic", transitionOut:

java grid bag layout: avoiding center alignment

纵饮孤独 提交于 2019-12-23 12:54:07
问题 In my GUI application, I have several JPanels that are instantiated at various points during the running of my program, and certain actions will cause one of them to be displayed in a scroll pane: mViewport.setViewportView(currentPanel); The trouble is, that my panels are done using Grid Bag Layouts, and the behaviour of that is to center itself within the JScrollPane it is inside of. This make the GUI look weird. Anyone know of a way to force a grid bag layout panel to top-left align? Thanks

Repainting a JPanel in a JScrollPane

左心房为你撑大大i 提交于 2019-12-23 12:14:58
问题 The project that I am working on is an inter-computer utility for playing table top games, and a key part of that is an interactive grid/map. Well I have built in functionality for custom map creation, and want the screen to be able to display very large maps, as well as very small maps. To this effect I have created a series of classes with which I can display a grid of any size. However what I would like to do is to put the JPanel which this is accomplished with into a JScrollPane, thereby

which component handles arrow KeyEvents when JTextPane is embedded in JScrollPane?

北城以北 提交于 2019-12-23 04:47:16
问题 OK here we go again. Steve has to program another non-standard set of key strokes. We have an editable JTextPane embedded in a JScrollPane. This pane correctly handles the Up and Down arrow keys, but I can't figure out how. If I could figure out how, I could implement the nonstandard things I need to implement. Specifically, because the PageDown key is globally mapped to doing another function we don't do the default actions for PageUp, PageDown,Ctrl-PageUp and Ctrl-PageDown. Instead we want

Moving JScrollPane horizontally results in blured text

[亡魂溺海] 提交于 2019-12-22 08:25:20
问题 I have a TextArea inside JScrollPane inside standard JPanel. JPanel panelMain = new JPanel(); panelMain.setBorder(titledBorder1); panelMain.setBounds(new Rectangle(2, 5, 970, 700)); panelMain.setLayout(null); JTextArea fieldBody = new JTextArea(); JScrollPane fieldBodyScrollPane = new JScrollPane(fieldBody); fieldBodyScrollPane.setBounds(70, 140, 790, 500); panelMain.add(fieldBodyScrollPane); When I type enough text in a single row the horizontal knob appears - so far good. But when I start

Enabling scroll bars when JTextArea exceeds certain amount of lines

余生长醉 提交于 2019-12-22 06:42:32
问题 this is my first time using any StackExchange website, so let's see how it goes. So I've been making a 'local' chat program in Java, and was using a JTextField for chat input. But I wanted to allow for multiline chatting so I switched to JTextArea. I'm using a GroupLayout (built with Window Builder Pro - eclipse) for easy window/component resizing. Here's a picture: The JTabbedPane, the JTextArea and the Send button are all contained in a JPanel, and all the stuff to the left is in it's own

How to reset a JTable

蹲街弑〆低调 提交于 2019-12-22 00:34:33
问题 I have a question with respect to JScrollPane and a JTable . I have added a JTable to a JScrollPane , and added the JScrollPane to the JPanel . When I click on 'show' button, the JTable will be filled with contents from the database. I also have another button reset , clicking on which will remove the contents of the JTable , and the JScrollPane . It is supposed to be doing that, but what happens is that, even after clicking the button, all the contents of the JTable and the JScrollPane still

MouseEvent lost in JScrollPane

旧时模样 提交于 2019-12-21 20:09:59
问题 This is the code I am using to show the issue which I am facing in another project. I am not getting any line like this if I use JScrollPane as a wrapper for panel2. Why? I want to click on JscrollPane and got event printed as following. java.awt.event.MouseEvent[MOUSE_CLICKED,(800,469),absolute(808,499),button=1,modifiers=Button1,clickCount=1] on javax.swing.JPanel[,0,0,934x612,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.border.LineBorder@cc0e01,flags=9

Make a Java JScrollpane only scroll vertically

旧城冷巷雨未停 提交于 2019-12-21 12:46:10
问题 I would like my entire JFrame to vertically scroll. I have added the following code, but it only creates a horizontal scrollbar. frame.setContentPane(new JScrollPane(new GradeQuickResource())); I want to do the opposite. I ONLY want a vertical scrollbar and NO horizontal scrollbar. I have seen the horizontal policy code, but it doesn't seem to work. I do not know what to name it. This code looks something like this: setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); Thanks!

JDesktopPane preferred size set by content

吃可爱长大的小学妹 提交于 2019-12-21 07:55:54
问题 I have been trying to tame JDesktopPane to work nicely with a resizable GUI & a scroll pane, but am having some troubles doing so. It seems that unless the drag mode is outline, the desktop pane will not resize as expected (when an internal frame is dragged beyond the edge of the desktop pane) & therefore not produce scroll-bars. Am I doing something very silly in this source? Have I missed a far better approach? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax