Java Code Examples for javafx.scene.control.TextArea#setId()
The following examples show how to use
javafx.scene.control.TextArea#setId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: F2FForm.java From bisq with GNU Affero General Public License v3.0 | 6 votes |
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload, Offer offer, double top) { F2FAccountPayload f2fAccountPayload = (F2FAccountPayload) paymentAccountPayload; addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, 0, Res.get("shared.country"), CountryUtil.getNameAndCode(f2fAccountPayload.getCountryCode()), top); addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.f2f.city"), offer.getF2FCity(), top); addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.f2f.contact"), f2fAccountPayload.getContact()); TextArea textArea = addTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.f2f.extra"), "").second; textArea.setPrefHeight(60); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(offer.getF2FExtraInfo()); return gridRow; }
Example 2
Source File: USPostalMoneyOrderForm.java From bisq with GNU Affero General Public License v3.0 | 5 votes |
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), ((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getHolderName()); TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textArea.setPrefHeight(70); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getPostalAddress()); return gridRow; }
Example 3
Source File: MainFm.java From tools-ocr with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void start(Stage primaryStage) { stage = primaryStage; stageInfo = new StageInfo(); stage.xProperty().addListener((observable, oldValue, newValue) -> { if (stage.getX() > 0){ stageInfo.setX(stage.getX()); } }); stage.yProperty().addListener((observable, oldValue, newValue) -> { if (stage.getY() > 0){ stageInfo.setY(stage.getY()); } }); screenCapture = new ScreenCapture(stage); processController = new ProcessController(); initKeyHook(); // ToggleGroup segmentGrp = new ToggleGroup(); // ToggleButton resetBtn = CommUtils.createToggleButton(segmentGrp, "resetBtn", this::resetText, "重置"); // ToggleButton segmentBtn = CommUtils.createToggleButton(segmentGrp, "segmentBtn", this::segmentText, "智能分段"); // resetBtn.setUserData("resetBtn"); // segmentBtn.setUserData("segmentBtn"); // // segmentGrp.selectToggle(segmentBtn); // segmentGrp.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { // isSegment = newValue.getUserData().toString().equals("segmentBtn"); // }); HBox topBar = new HBox( CommUtils.createButton("snapBtn", MainFm::doSnap, "截图"), CommUtils.createButton("openImageBtn", MainFm::recImage, "打开"), CommUtils.createButton("copyBtn", this::copyText, "复制"), CommUtils.createButton("pasteBtn", this::pasteText, "粘贴"), CommUtils.createButton("clearBtn", this::clearText, "清空"), CommUtils.createButton("wrapBtn", this::wrapText, "换行") //CommUtils.SEPARATOR, resetBtn, segmentBtn ); topBar.setId("topBar"); topBar.setMinHeight(40); topBar.setSpacing(8); topBar.setPadding(new Insets(6, 8, 6, 8)); textArea = new TextArea(); textArea.setId("ocrTextArea"); textArea.setWrapText(true); textArea.setBorder(new Border(new BorderStroke(Color.DARKGRAY, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT))); textArea.setFont(Font.font("Arial", FontPosture.REGULAR, 14)); ToolBar footerBar = new ToolBar(); footerBar.setId("statsToolbar"); Label statsLabel = new Label(); SimpleStringProperty statsProperty = new SimpleStringProperty("总字数:0"); textArea.textProperty().addListener((observable, oldValue, newValue) -> statsProperty.set("总字数:" + newValue.replaceAll(CommUtils.SPECIAL_CHARS, "").length())); statsLabel.textProperty().bind(statsProperty); footerBar.getItems().add(statsLabel); BorderPane root = new BorderPane(); root.setTop(topBar); root.setCenter(textArea); root.setBottom(footerBar); root.getStylesheets().addAll( getClass().getResource("/css/main.css").toExternalForm() ); CommUtils.initStage(primaryStage); mainScene = new Scene(root, 670, 470); stage.setScene(mainScene); stage.show(); }
Example 4
Source File: CashDepositForm.java From bisq with GNU Affero General Public License v3.0 | 4 votes |
@Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; String countryCode = cashDepositAccountPayload.getCountryCode(); addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentAccount.getPaymentMethod().getId())); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : ""); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addHolderNameAndIdForDisplayAccount(); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), cashDepositAccountPayload.getHolderEmail()); if (BankUtil.isBankNameRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.name"), cashDepositAccountPayload.getBankName()).second.setMouseTransparent(false); if (BankUtil.isBankIdRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode), cashDepositAccountPayload.getBankId()).second.setMouseTransparent(false); if (BankUtil.isBranchIdRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode), cashDepositAccountPayload.getBranchId()).second.setMouseTransparent(false); if (BankUtil.isNationalAccountIdRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(countryCode), cashDepositAccountPayload.getNationalAccountId()).second.setMouseTransparent(false); if (BankUtil.isAccountNrRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode), cashDepositAccountPayload.getAccountNr()).second.setMouseTransparent(false); if (BankUtil.isAccountTypeRequired(countryCode)) addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode), cashDepositAccountPayload.getAccountType()).second.setMouseTransparent(false); String requirements = cashDepositAccountPayload.getRequirements(); boolean showRequirements = requirements != null && !requirements.isEmpty(); if (showRequirements) { TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.extras"), "").second; textArea.setMinHeight(30); textArea.setMaxHeight(30); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(requirements); } addLimitations(true); }