javafx-2

How to make a button appear to have been clicked or selected? (JavaFX2)

∥☆過路亽.° 提交于 2020-01-10 14:14:47
问题 When user presses a button in my JavaFX2.2 UI, a dark blue halo appears to show it was clicked. During the course of events, my program may want to 'unclick' it to show it is no longer selected. I expected a button.setSelected(false); I remember Swing used to have this, but there isn't such a call in JavaFx. This article discusses drop shadows but I want to simply use the same appearance used when a button is clicked which isn't really a drop shadow. setEffect(new DropShadow()) Using setStyle

How to make a button appear to have been clicked or selected? (JavaFX2)

半腔热情 提交于 2020-01-10 14:14:07
问题 When user presses a button in my JavaFX2.2 UI, a dark blue halo appears to show it was clicked. During the course of events, my program may want to 'unclick' it to show it is no longer selected. I expected a button.setSelected(false); I remember Swing used to have this, but there isn't such a call in JavaFx. This article discusses drop shadows but I want to simply use the same appearance used when a button is clicked which isn't really a drop shadow. setEffect(new DropShadow()) Using setStyle

Resize JavaFX tab when double click

久未见 提交于 2020-01-10 05:19:05
问题 I have this simple example with JavaFX tabs: public class test extends Application { private BorderPane root; // Navigation Utilization private ActionTabs actiontabs; @Override public void start(Stage primaryStage) { // Set Main Window Label primaryStage.setTitle("Desktop Client"); Image iv = new Image(getClass().getResource("/images/internet-icon.png").toExternalForm()); primaryStage.getIcons().add(iv); root = new BorderPane(); root.setLeft(getLeftHBox(primaryStage, root)); Scene scene = new

Disable TreeItem's default expand/collapse on double click JavaFX 2.2

大兔子大兔子 提交于 2020-01-10 04:16:12
问题 I am working on a JavaFX 2.2 project and i want to set custom handling of the mouse (double) click event on a TreeItem. Using treeview.setOnMouseClicked i fire my code without errors but the problem is that the TreeItem, on every mouse double click, it toggles between expanded and collapsed. I suppose that this is the default behavior, but how i disable it?? 回答1: I had the same issue and solved it in time using EventDispatcher . class TreeMouseEventDispatcher implements EventDispatcher {

JAVAFX ListView chatting

我怕爱的太早我们不能终老 提交于 2020-01-09 12:05:22
问题 I need to insert values in list view in one by one like chatting. now my code is @FXML private ListView<String> messageList; private ObservableList<String> messages = FXCollections.observableArrayList(); messageList.setItems(messages); 回答1: This may be similar to what you are asking. Main: import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class ChatApp extends Application { @Override

JAVAFX ListView chatting

醉酒当歌 提交于 2020-01-09 12:04:59
问题 I need to insert values in list view in one by one like chatting. now my code is @FXML private ListView<String> messageList; private ObservableList<String> messages = FXCollections.observableArrayList(); messageList.setItems(messages); 回答1: This may be similar to what you are asking. Main: import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class ChatApp extends Application { @Override

JAVAFX ListView chatting

末鹿安然 提交于 2020-01-09 12:04:44
问题 I need to insert values in list view in one by one like chatting. now my code is @FXML private ListView<String> messageList; private ObservableList<String> messages = FXCollections.observableArrayList(); messageList.setItems(messages); 回答1: This may be similar to what you are asking. Main: import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class ChatApp extends Application { @Override

JavaFX FXML Parameter passing from Controller A to B and back

旧时模样 提交于 2020-01-09 11:25:26
问题 I want to create a controller based JavaFX GUI consisting of multiple controllers. The task I can't accomplish is to pass parameters from one Scene to another AND back. Or in other words: The MainController loads SubController's fxml, passes an object to SubController, switches the scene. There shall not be two open windows. After it's work is done, the SubController shall then switch the scene back to the MainController and pass some object back. This is where I fail. This question is very

JavaFX FXML Parameter passing from Controller A to B and back

泪湿孤枕 提交于 2020-01-09 11:25:11
问题 I want to create a controller based JavaFX GUI consisting of multiple controllers. The task I can't accomplish is to pass parameters from one Scene to another AND back. Or in other words: The MainController loads SubController's fxml, passes an object to SubController, switches the scene. There shall not be two open windows. After it's work is done, the SubController shall then switch the scene back to the MainController and pass some object back. This is where I fail. This question is very

JavaFX: How to make a Node partially mouse transparent?

霸气de小男生 提交于 2020-01-09 11:09:15
问题 Simplified Problem: Make one Node "A" that is on top of another Node "B" to be half transparent to MouseEvents, so the Events will reach the underlying Node "B". Both Nodes are of equal size but Node "A" has a half transparent background image so one half of Node "B" is visible. Real Problem: I have a menu of tabs. Each tab can be dragged to expand the corresponding menu layer. Therefore each tab layer is a Pane with a partially transparent background (basically a polygon) of which the