- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
开发基于 Java + Swing 的桌面应用程序 我遇到了创建一个单选按钮的问题,该按钮旁边应该有图像,而不是旁边的文本,或者说,另一个像微调器这样的小部件。
点击图片或微调器也应该选择相应的单选按钮。
这可能吗?如果是,怎么办?
最佳答案
对我来说,为构造函数提供图标的 JRadioButton 似乎不起作用;它用给定的图标替换了“ native 单选按钮图标”。我认为除了“单选按钮图标”之外,还需要带有图标的单选按钮。
关于 Bug #4177248 的 Sun 错误数据库的行为存在一些争论。但未进行任何更改。
相反,可以尝试 JRadioButtonMenuItem ,即使可能会有一些不需要的行为?
对 JRadioButton 和 JRadioButtonMenuItem 的简短评估:
public class IconRadioButtonEval {
public static void main(String[] args) throws Exception {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
// Use some arbitrary working URL to an icon
URL url =
new URL(
"http://mikeo.co.uk/demo/sqlspatial/Images/RSS_Icon.png");
Icon icon = new ImageIcon(url);
JRadioButton button = new JRadioButton(icon);
panel.add(new JLabel("RadioButton with icon:"));
panel.add(button);
panel.add(new JLabel("RadioButtonMenuItem with icon:"));
panel.add(new JRadioButtonMenuItem(icon));
frame.getContentPane().add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
Justin 建议在 JRadioButton 旁边使用空字符串的另一个组件在大多数情况下应该可以正常工作。
关于java - 丰富的 Swing 单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3149711/
我想用个人详细信息来丰富订单集合。 假设我已经(示例在 json 中): [ { "orderId": 123, "quantity": 5, "buyerI
def classify(numb): i=1 j=1 sum=0 for i in range(numb): for j in range(numb)
我正在尝试使用 Spark 处理来自 HBase 表的数据。 This blog post给出了如何使用 NewHadoopAPI 从任何 Hadoop InputFormat 读取数据的示例。 我做
我使用 rich:menuitem 在 Richfaces 上构建了菜单。我需要确定用户单击了哪个菜单项。我尝试使用: 但是,我在请求参数中没有看到参数
注意:我遗漏了不相关的代码 所以我目前正在研究 CCC 1996 P1,这个问题的全部目的是能够计算一个整数输入是完美数、不足数还是充数。我上面列出的代码可以工作,但是我认为它太慢了。该代码会迭代每个
我们正在考虑将 ACS 作为我们的联合 STS。我们可以将自己的自定义 STS 配置为 IP-STS,以及“内置”身份提供商,例如 Facebook、Live 和 Google。然而,我们收到的 cl
我使用以下命令成功创建了一个绘图: # suppose I have a p <- ggplot(data=df, ...) then the following works # I get thos
我正在使用 spring-data-rest 存储库从 REST API 公开常见的 CRUD 操作。 但是我需要为这些操作添加额外的功能。 例如我想向第三方 API 发送关于删除的 HTTP 请求。
我有一个java支持bean,它有一个方法(称之为getDataList()),它返回ArrayList . 在 MyType.java我有很多 setter 和 getter,它们都分配 Strin
我正在使用以下代码:
我正在尝试在facelet组合中使用rich:faces组件rich:jQuery。但我无法产生任何 jquery 调用。 另一个问题...我将如何重写它以落入第一模式
是否可以将 Firebase 上游消息作为可操作通知进行传递?这就是我想要实现的目标:我希望能够将可操作的上游 Firebase 消息从我的 iPad 发送到我的 iPhone。 这可能吗? 这是我的
我有richfaces应用程序。在页面中,定义了 jQuery 函数: 然后我有一些 a4j:commandLink,它应该在完成 ajax 请求时调用该函数。 不幸的是,它不起作用。我知道 on
我有一个 rich:tree 组件,如下使用:
对于客户,我们需要为集成测试生成详细的测试报告,这些报告不仅表明一切都是绿色的,而且还表明测试做了什么。我和我的同事都很懒惰,我们不想破解电子表格或文本文档。 为此,我想了一种方法来记录更复杂的集成测
我在构建 Clojure 时遇到了一些困难基于 Web 应用程序。这是一个简单的 CRUD 应用程序,我开始探索 Clojure 网络生态系统。我正在尝试不同的库,例如 Hiccup , Enlive
我正在编写一个 Flink 流程序,其中我需要使用一些静态数据集(信息库,IB)来丰富用户事件的 DataStream。 对于例如假设我们有一个买家的静态数据集,并且有一个传入的事件点击流,对于每个事
在我的应用程序中,我有一个记录列表。用户可以选择任何记录,更新选项菜单。表格显示了这些记录,它有分页。 所以问题是,当我选择一条记录并对列表进行排序(使我之前选择的记录转到另一个页面)时,我看不到所选
我有一棵树(父级可以有任意数量的子级)和一个用于按名称搜索节点的 inputText 。假设有以下树: A --A1 ----AA1 --A2 其中 A 有两个子级 A1 和 A2,A1 有一个子级
我有一个 rich:dataTable 和一个 rich:dataScroller。当我单击 datascroller 时,我的 dataTable 不会自动刷新以显示正确的页面。但是,如果我按下刷新
我是一名优秀的程序员,十分优秀!