javafx-2

CSS3 to style Java?

孤人 提交于 2020-01-04 16:59:09
问题 I'm about to begin a project in Java where I'm essentially making a dumbed-down iTunes clone. I will be using Swing to make the GUI, but I was wondering the best way to style it in a way similar to iTunes beyond just changing colors/fonts/borders. I have looked into using CSS along with Java Swing, but any resources I've found are out of date. Are there any new ways to approach this? Or should I be looking into something besides CSS? Here is the design I'm looking to implement via Swing (the

DirectoryChooser Javafx buged?

孤人 提交于 2020-01-04 11:13:52
问题 I'm using Directory Chooser for set a TextField with the selected path. If I choose some directory like Desktop, or any other folder it returns the path, BUT if I choose the directorys from my library like my Documents (C:\Users\Victor\Documents) it returns null. Is it a bug?? I'm using the code below: DirectoryChooser chooser = new DirectoryChooser(); chooser.setTitle("Selecione o diretório"); File defaultDirectory = new File(folderChooser); chooser.setInitialDirectory(defaultDirectory);

DirectoryChooser Javafx buged?

[亡魂溺海] 提交于 2020-01-04 11:13:17
问题 I'm using Directory Chooser for set a TextField with the selected path. If I choose some directory like Desktop, or any other folder it returns the path, BUT if I choose the directorys from my library like my Documents (C:\Users\Victor\Documents) it returns null. Is it a bug?? I'm using the code below: DirectoryChooser chooser = new DirectoryChooser(); chooser.setTitle("Selecione o diretório"); File defaultDirectory = new File(folderChooser); chooser.setInitialDirectory(defaultDirectory);

registering changelistener to group of nodes in javafx

孤者浪人 提交于 2020-01-04 06:25:15
问题 Is there any way to add a changelistener to group of nodes for following changes? For example, we can add a changelistener to a tabpane for getting tabselectedproperty. I want to add changelistener a to a group of buttons for getting buttonActionedProperty! I want to get old button and new button.... Is there any way to do this? 回答1: When you compare the tabs in a tab pane to a collection of buttons, you're not really comparing like to like. A tab pane naturally has a sense of which tab is

Setting JavaFX TreeView Line Style

别说谁变了你拦得住时间么 提交于 2020-01-04 04:55:11
问题 In Java Swing, there is JTree.linestyle property that enables/disables lines connecting the parent nodes in a tree to their children. Is there something similar in JavaFX 2? In all of the TreeView examples I've looked at for JavaFX, I haven't seen this. I also didn't see a CSS property to set. 回答1: JavaFX 2.2 does not have such a setting out of the box. A feature request could be filed in the JavaFX issue tracker. You may be able to achieve the line connection effect by creating custom

Getting the width and height of the center space in a BorderPane (JavaFX 2)

我的未来我决定 提交于 2020-01-04 04:40:09
问题 I have a simple BorderPane instance which is the root node of my Scene . The border pane include a panel on the right side with some GUI controls, including a button. When I click on this button, I create an instance of class ( Foo ) which extends StackPane and I put this instance as a center node of the border pane. I would like to get the width and height values of the available center space of the border pane from the Foo instance by calling this.getLayoutBounds.getWidth() , respectively .

How to set fx:value using resource bundle?

回眸只為那壹抹淺笑 提交于 2020-01-04 04:28:50
问题 In java fx it is possible to use i18n labels for components using the %key notation. For example - <Label layoutX="151.0" layoutY="14.0" text="%windowTitle"> <font> <Font size="22.0" /> </font> </Label> Is it possible to use i18n for component values? The following code does not work - <ChoiceBox layoutX="140.0" layoutY="67.0" prefWidth="164.0"> <items> <FXCollections fx:factory="observableArrayList"> <String fx:value="%listValue1" /> <String fx:value="%listValue2" /> <String fx:value="

JavaFX VBox and HBox layouts

送分小仙女□ 提交于 2020-01-03 17:29:15
问题 I'm working on a JavaFX application which has a layout generated from an external data structure, composed of displaying components that know their own aspect ratios (height as a dependent of width) 2 types of structural components that display all children with an equal width across their page, each child up as much vertical space as needed display all children down the page using the full width and taking as much vertical space as needed But I'm finding things aren't displaying as I expect.

JavaFX jar with dependencies bundled

半世苍凉 提交于 2020-01-03 17:10:17
问题 I just made a question about using javafxpackager to make JavaFX jars, you can see it here. My problem was that I couldn't include the classpath in the manifest. Well, while I was waiting for the answer, I tried maven-antrun-plugin instead. It worked nice, and I could run my application with dependencies, BUT (there is always a but) only with the dependencies OUTSIDE my final jar. So it is like that: FinalJar.jar lib |_{all dependencies here} My manifest file is pointing to the dependencies

How to get current TreeItem reference which is expanding by user click in JavaFx 2?

眉间皱痕 提交于 2020-01-03 15:23:34
问题 In one JavaFx 2 case, i have a TreeView, which is collapsed at certain depth initially. What i'm aiming to achieve is that when one node is being expanded by user click, an action will happend to modified that treeitem property/values. the problem is that i'm not sure how to refer to that treeitem. I add a listener on each treeitem expanedProperty, but in that ChangeListner method, i can only get old/new values, can't refer back to the treeitem that change event originates. Can someone help?