Tag: 滚动条

Java中的JScrollPane

我写了一些代码来看看滚动窗格如何起作用但我的代码从未起作用。 这是代码, public Fenetre(){ this.setTitle(“Data Simulator”); this.setSize(300, 300); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); String hello = “hello”; int number = 69; JPanel content = new JPanel(); content.setBackground(Color.LIGHT_GRAY); //Box imad = Box.createHorizontalBox(); JTextArea textArea = new JTextArea(10, 10); JLabel imad = new JLabel(); imad.setText(hello + ” your favorite number is ” + number + “\nRight?”); JScrollPane scrollPane = new […]

JComboBox上的JScrollPane

我做了一个combobox,但有些元素比我的盒子宽度宽。 所以我尝试添加一个水平的scrolpane,我唯一能看到的是一个带有combobox的滚动条! Certanly我做错了。 所以这是我没有jscrolpane的代码。 issuerdocumentJComboBox=new JComboBox(issuermodel);//the compo box issuerdocumentJComboBox.setBounds(430, 120, 100, 30); searchDocumentesJPanel.add(issuerdocumentJComboBox); 如何在combobox中添加水平滚动条? 谢谢!

如何在JavaFx中添加ScrollBar

我正在尝试将一个ScrollBar添加到HBox。 ScrollBar被添加,但我没有滚动。 我怎样才能使它工作? public class ScrollableItems { public void scrollableItems(HBox content) { double height = 180; ScrollBar sc = new ScrollBar(); content.getChildren().add(sc); sc.setLayoutX(content.getWidth() – sc.getWidth()); sc.setMin(0); sc.setOrientation(Orientation.VERTICAL); sc.setPrefHeight(height); sc.setMax(height * 2); sc.valueProperty().addListener(new ChangeListener() { public void changed(ObservableValue ov, Number old_val, Number new_val) { content.setLayoutY(-new_val.doubleValue()); } }); } } 将子项添加到HBox然后将其传递给上面的scrollableItems(HBox content)以添加SCrollBar public HBox mainItemsWrapper() { HBox […]

SWT树>将垂直滚动条移动到树的左侧而不更改方向

如何将垂直滚动条放在树的左侧?

将滚动条添加到JFreeChart 3DBarChart

我可以在JFreeChart中添加一个滚动条,允许我水平移动条形图吗? JFreeChart chart = ChartFactory.createBarChart3D( title, “X”, “Y”, dataset, PlotOrientation.VERTICAL, true, false, false ); 因为数据集可能很长,没有足够的宽度来显示结果…… 我可以使用JSlide吗? 或其他方法? 如果可能的话,请给我一些示例代码。 谢谢!

如何使用JScrollbar滚动我的JFrame?

我有个问题。 我有一个JFrame与一些JTextFields,JLabels,Jlists和JButton现在我的框架的内容超过了屏幕区域所以我想将JScrollBar附加到我的JFrame但我的srollbar不起作用。 那么,任何人都可以指导我如何使用JScrollbar滚动我的JFrame吗?

最终使用滚动条的JPanel列表

我试图为我的Java应用程序构建一个GUI。 我动态添加JPanels,这是我GUI中的“行”。 在面板列表下面有一个添加新面板的按钮。 随着List的增长,它到达父Container的末尾。 然后我想使用滚动条,以便用户能够到达列表中的每个面板。 到目前为止,我尝试了JScrollPanes和Layouts,但我不知道如何让它工作。 你能给我一些建议吗? this.setLayout(new BorderLayout()); JPanel listContainer = new JPanel(); listContainer.setLayout(BoxLayout(listContainer, BoxLayout.Y_AXIS); this.add(new JScrollPane(listContainer), BorderLayout.CENTER); this.add(new JButton(), BorderLayout.PAGE_END); //then i add panels to the listContainer. this wont work, when the space is complettly used there is no scrollbar.

定制设计JScollPane Java Swing

我需要为我的所有scrollpanes设计这个滚动条: 使用Java Swing。 我正在使用Netbeans IDE。 什么是最简单的解决方案? 非常感谢你。 问候