问题标签 [titled-border]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - titledborder 的标题必须是可点击的
我想创建一个带有标题边框的面板。并且标题必须是可点击的。有没有办法做到这一点?因为当我在面板上放置一个 mouslistener 时,您可以单击面板上的任何位置,事件就会发生。只有当我点击titledborder的标题时才必须触发它
javafx - JavaFX: ClassNotFoundException for imported class in FXML
I'm trying to create a textfield with a title embedded in the field border like:
Following the solution posted here I've created a .java file called TitledBorder.java
within my src>main>java
directory. My FXML is in the src>main>resources
directory and I've added:
<?import TitledBorder?>
at the top and it shows no error like:
I then added this code to the FXML
and it shows no error either. I then launch my main method which is in a class also in src>main>java but it gets an error in the .fxml saying javafx.fxml.LoadException:
/C:/Users/ME/Documents/Automation/target/classes/demofxml.fxml
and
I'm not sure why it references "/target/classes/..." as opposed to "/src/main/java/...".
This is the only FXML example I've found so I'm confused why I'm getting an error upon compiling, yet no errors are shown prior? Removing all reference to TitledBorder
allows all my code to function/compile properly. Since its in the src package I use this code in FXML to connect w/ controller fx:controller="loadController">
. CSS is added properly too.
Thoughts?
java - 使 TitledBorder 标题可编辑
有没有办法使 TitledBorder 中的标题可编辑,以便用户可以编辑标题是什么?或者,如果有另一个边界可能允许这样做,那是什么?
编辑:
这是我基于双击的更具体的编辑问题的链接:双击 时使 TitledBorder 可编辑
java - 双击使 TitledBorder 可编辑
这是以下内容的扩展:使 TitledBorder 标题可编辑
更具体地说,我希望在双击标题时可以编辑 TitledBorder。我将边框放置在使用 BoxLayout 的 java Box 周围。双击最好会在那里打开一个 JTextField,但如果不能这样做,打开另一个窗口来编辑标题是可以接受的。
java - 如何在 TitledBorder 中找到标题的 x 位置
我试过getTitlePosition,但它似乎只返回边框的起点0,而不是标题本身。我也尝试了 getBorderJustification,但它返回了 Center 的 int 值。
有没有办法在 TitledBorder 中获取实际文本的 x 位置?
java - Creating JPanels with a titled border in a for loop from user input
I want to create a for loop that creates JPanel
containers with titled headers. the number of iterations depends on the user input from previous interfaces.
The noofpara
is the number of perimeters the user chose according to that the for loop should create panels with the titled border with the number of perimeters. the error appears at the jpanel1.add...
where it says void type not allowed.
java - Java + Swing:有没有办法让“TitledBorder”不可见?
我已经创建了一个JFrame
带有 aJPanel
的,通过单击列表中的项目变得可见/不可见。我想要一个TitledBorder
(这也是类名)绕过它。
我已经尝试了一些方法(setVisible
, setBorderPainted
),但没有一个适用于该课程。我在 Java 文档中也找不到合适的方法!
我的目标是在面板存在时使边框不可见,而在面板存在时使边框可见。各种解决方案都会有所帮助。
java - 使 TitledBorder 不可见?
所以我有以下 JComponent 我想在某些条件下使其不可见:
除了 titledBorder 之外,我能够使所有内容都看不见,当我这样做时由于某种原因它不会消失:
即使我尝试强制将其设置为 null,它仍然可见:
当我尝试这样做时,同样的事情:
以下是边框的创建方式:
有什么方法可以让它像 createStop() 方法的其他元素一样不可见?