本文整理汇总了Java中javafx.scene.control.RadioButton.setDisable方法的典型用法代码示例。如果您正苦于以下问题:Java RadioButton.setDisable方法的具体用法?Java RadioButton.setDisable怎么用?Java RadioButton.setDisable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.RadioButton
的用法示例。
在下文中一共展示了RadioButton.setDisable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RadioButtons
import javafx.scene.control.RadioButton; //导入方法依赖的package包/类
public RadioButtons() {
super(400,100);
ToggleGroup tg = new ToggleGroup();
VBox vbox = new VBox();
vbox.setSpacing(5);
RadioButton rb1 = new RadioButton("Hello");
rb1.setToggleGroup(tg);
RadioButton rb2 = new RadioButton("Bye");
rb2.setToggleGroup(tg);
rb2.setSelected(true);
RadioButton rb3 = new RadioButton("Disabled");
rb3.setToggleGroup(tg);
rb3.setSelected(false);
rb3.setDisable(true);
vbox.getChildren().add(rb1);
vbox.getChildren().add(rb2);
vbox.getChildren().add(rb3);
getChildren().add(vbox);
}
示例2: rb
import javafx.scene.control.RadioButton; //导入方法依赖的package包/类
protected RadioButton rb(String text, boolean selected, boolean disabled)
{
RadioButton b = new RadioButton(text);
b.setSelected(selected);
b.setDisable(disabled);
return b;
}
示例3: getRadioButton
import javafx.scene.control.RadioButton; //导入方法依赖的package包/类
public RadioButton getRadioButton(String text, HBox hbox, ToggleGroup group)
{
RadioButton button = new RadioButton(text);
hbox.getChildren().add(button);
button.setToggleGroup(group);
button.setDisable(true);
return button;
}
示例4: createButtonBar
import javafx.scene.control.RadioButton; //导入方法依赖的package包/类
private ToolBar createButtonBar(boolean selectable, boolean editable) {
ToolBar toolBar = new ToolBar();
label = new Label(getLabel());
ToggleGroup toggleGroup = new ToggleGroup();
success = new RadioButton("Success");
fail = new RadioButton("Fail");
notes = new RadioButton("Notes");
success.setDisable(!editable);
fail.setDisable(!editable);
notes.setDisable(!editable);
success.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (success.isSelected()) {
selected = 1;
}
textArea.setDisable(success.isSelected());
});
fail.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (fail.isSelected()) {
selected = 3;
}
textArea.setDisable(success.isSelected());
});
notes.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (notes.isSelected()) {
selected = 2;
}
textArea.setDisable(success.isSelected());
});
if (selected == 1) {
success.setSelected(true);
} else if (selected == 3) {
fail.setSelected(true);
} else if (selected == 2) {
notes.setSelected(true);
} else {
success.setSelected(editable);
}
toggleGroup.getToggles().addAll(success, fail, notes);
Region region = new Region();
HBox.setHgrow(region, Priority.ALWAYS);
toolBar.getItems().addAll(label, region, success, fail, notes);
return toolBar;
}
示例5: createOpenDisplayDetails
import javafx.scene.control.RadioButton; //导入方法依赖的package包/类
/** @return Sub-pane for OpenDisplay action */
private GridPane createOpenDisplayDetails()
{
final InvalidationListener update = whatever ->
{
if (updating || selected_action_index < 0)
return;
actions.set(selected_action_index, getOpenDisplayAction());
};
final GridPane open_display_details = new GridPane();
// open_display_details.setGridLinesVisible(true);
open_display_details.setHgap(10);
open_display_details.setVgap(10);
open_display_details.add(new Label(Messages.ActionsDialog_Description), 0, 0);
open_display_description = new TextField();
open_display_description.textProperty().addListener(update);
open_display_details.add(open_display_description, 1, 0);
GridPane.setHgrow(open_display_description, Priority.ALWAYS);
open_display_details.add(new Label(Messages.ActionsDialog_DisplayPath), 0, 1);
open_display_path = new TextField();
open_display_path.textProperty().addListener(update);
final Button select = new Button("...");
select.setOnAction(event ->
{
try
{
final String path = FilenameSupport.promptForRelativePath(widget, open_display_path.getText());
if (path != null)
open_display_path.setText(path);
FilenameSupport.performMostAwfulTerribleNoGoodHack(action_list);
}
catch (Exception ex)
{
logger.log(Level.WARNING, "Cannot prompt for filename", ex);
}
});
final HBox path_box = new HBox(open_display_path, select);
HBox.setHgrow(open_display_path, Priority.ALWAYS);
open_display_details.add(path_box, 1, 1);
final HBox modes_box = new HBox(10);
open_display_targets = new ToggleGroup();
final Target[] modes = Target.values();
for (int i=0; i<modes.length; ++i)
{
final RadioButton target = new RadioButton(modes[i].toString());
target.setToggleGroup(open_display_targets);
target.selectedProperty().addListener(update);
if (modes[i] == Target.STANDALONE && !Preferences.isStandaloneWindowSupported())
target.setDisable(true);
modes_box.getChildren().add(target);
}
open_display_details.add(modes_box, 0, 2, 2, 1);
open_display_macros = new MacrosTable(new Macros());
open_display_macros.addListener(update);
open_display_details.add(open_display_macros.getNode(), 0, 3, 2, 1);
GridPane.setHgrow(open_display_macros.getNode(), Priority.ALWAYS);
GridPane.setVgrow(open_display_macros.getNode(), Priority.ALWAYS);
return open_display_details;
}