jscrollpane

Can't seem to add JTextArea to JScrollPane?

别来无恙 提交于 2019-12-25 18:33:36
问题 I'm running in to a small snag here...I was trying to create a scrollable text area, and I've implemented it using the following code snippet, which I'm fairly sure is okay. I'd appreciate if you could tell me what's wrong with it? JTextArea textArea = new JTextArea(); textArea.setBackground(Color.WHITE); textArea.setPreferredSize(new Dimension(600, 200)); textArea.setWrapStyleWord(true); textArea.setLineWrap(true); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane

jScrollPane Trouble

你说的曾经没有我的故事 提交于 2019-12-25 16:39:12
问题 I have used jScrollPane on my site. I'm also using ajax to update the data on the same div where the jScrollPane is used. Now, when i append the returned data to the div, the scrollbar is not visible on the appended text. It may because the jQuery function is called when the document loads but now any ideas to solve this problem? I read the article here here http://jscrollpane.kelvinluck.com/auto_reinitialise.html but i'm not being able to solve this problem. Here's the code: function

My JscrollPane isn't scrolling (vertically) the entire image,

自闭症网瘾萝莉.ら 提交于 2019-12-25 09:39:37
问题 when I increase the preferredSize, more of the Bufferedimage(on a JPanel, on a JFrame) is found. The size of the image is going to vary depending on the size of the file my program is reading, where I set the scrollpane; public Frame(String title, int theWidth, int theHeight) throws FileNotFoundException { super(String.format("Title", title)); this.width = theWidth; this.height = theHeight; this.panel = new Panel(width, height); this.scroller = new JScrollPane(this.panel); this.panel

Java - Prevent Resize but keep adding text to JTextArea with JScrollPane

被刻印的时光 ゝ 提交于 2019-12-25 08:57:56
问题 I have made a JTextArea in which I log some info(With an endless loop) I have already set the Preferred Size and added it to a JScrollPane . After logging messages reach the limit of the Jtextarea they stop printing on the screen . I want then to keep printing (and the scrollbar getting smaller and smaller), pretty much like a CMD prompt does. This is necessary because I already have another Jtextfield below and a button 回答1: Don’t set a preferred size on the JTextArea . Set the preferred

GridbagLayout within ScrollPane Java Swing

那年仲夏 提交于 2019-12-25 07:38:34
问题 I'd just made a layout in GridBagLayout for a split pane. Worked perfectly and looked right. I then needed to then add a scroll bar vertically only. Hence I have done that now. However the layout doesn't 'size' like before. It now stretches across rather sticking to the area of the pane shown. JSplitPane VPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,(new class1()),new JScrollPane(new class2(),ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); I

div jspVerticalBar missing inside the jspContainer

佐手、 提交于 2019-12-25 07:20:10
问题 In my current web project Im trying to change the scrollbar with a lib called jScrollPane. The script applies and generates the jspContainer, but the div jspVerticalBar ist missing. First I thought the script got problems when its loaded in with .load. But I placed the script tag in the view.html that is getting loaded in. Another problem is when I go to another view and return to the front page, the script generates a wrong width of the container. Is is so small that the content of the

How to make a scrollable JTable

て烟熏妆下的殇ゞ 提交于 2019-12-25 05:22:43
问题 Question 1) I have a JPanel ps, which has a null layout; a JScrolPane scrollPane, and a JTable table. I have added the table to the scrollPane, and then added the scrollPane to the Jpanel ps. The following is my code for doing that:- ps = new JPanel(); ps.setLayout(null); ps.setSize(1000,600); scrollPane = new JScrollPane(); scrollPane.setBounds(10, 119, 975, 300); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); ps.add(scrollPane); table = new JTable(data,

fixing JScrollPane with JLabel

时间秒杀一切 提交于 2019-12-25 04:25:04
问题 In order to add a background Image , I work on JLabels instead of JPanel . JFrame frame=new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel label=new JLabel(new ImageIcon("bg.png")); label.setLayout(new BoxLayout(label, BoxLayout.Y_AXIS)); for(int i=0;i<20;i++) label.add(new JLabel(i.toString())); frame.add(label); the problem here is that only components that fit the background image will be shown (in my example only the 10 first JLabels) I tried using a JScrollPane

Java - JScrollPane with JTable not shown

江枫思渺然 提交于 2019-12-25 04:17:33
问题 I have a JPanel where I add a JScrollPane (see class below). I added a JTextField to verify that everything works (instead of the JScrollPane) and the text field was added to the Panel. When I try to add my JScrollPane nothing (white background) is shown. How can I fix that? protected JPanel createContentPanel() { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); final String[] columnNames = { "Test1", "Test2", "Test3" }; final String[][] data = { { "foo1", "foo2", "foo3" }, {

My custom JDialog appears minimized and JScrollPane's scroll disappears

怎甘沉沦 提交于 2019-12-25 03:36:36
问题 I have created a basic swing program which displays an image in a JDialog box after it has been selected through a JFileChooser . I have used a JScrollPane inside the dialog box and a JLabel on which image is added as an icon, inside the pane. The following is the code I have used to construct the dialog box and its contents, the objects are already initialized with a simple new call: jDialog1.setTitle("Image"); jDialog1.setModal(true); jLabel1.setHorizontalAlignment(javax.swing