小编Lau*_*aro的帖子

Java,Swing,获取和更改所有输入字段

我正在编写一个选项的pannel,并且为了能够在开发应用程序时更快地添加更多选项,我决定将所有输入的组件放在一个Frame中,我需要从配置中加载它们的值并设置相应的文本但它似乎无法从字段中获取组件的文本.我得到一个:
线程"AWT-EventQueue-0"中的异常java.lang.RuntimeException:无法编译的源代码 - 错误的sym类型:java.awt.Component.setText
Nombre:server Clase:class javax.swing.JTextField

private void loadConfigs() {
    List<Component>  compList = getAllComponents(this);
    System.out.println("Tamaño "+compList.size());
    for(int i=0; i<compList.size();i++) {
       if(compList.get(i).getName() != null) {
           System.out.println("Nombre: "+compList.get(i).getName() +" Clase:"+ compList.get(i).getClass().toString());
           if(compList.get(i).getClass().toString().matches("class javax.swing.JTextField")) {
               System.out.println("Machea load " +compList.get(i).getName() + compList.get(i).toString());
               compList.get(i).setText(rootFrame.config.get(compList.get(i).getName()));
           }
           else if(compList.get(i).getClass().toString().matches("class javax.swing.JCheckBox")) {
                if (rootFrame.config.get(compList.get(i).getName()) == null) {
                    compList.get(i).setSelected(false);
                }
                else {
                    compList.get(i).setSelected(true);
                }
           }
       }
    }
}
public static List<Component> getAllComponents(final Container c) {
    Component[] comps = c.getComponents();
    List<Component> compList = new ArrayList<Component>();
    for (Component comp : …
Run Code Online (Sandbox Code Playgroud)

java swing components input edit

4
推荐指数
2
解决办法
1738
查看次数

Mysql Connector C ++并浮动

我找不到关于从结果集中获取浮点数或如何在准备好的语句中存储浮点数以创建查询以插入浮点数的任何信息。是否有可能做到这一点?我应该使用char数组存储它们吗?提前致谢

c++ mysql connector

4
推荐指数
1
解决办法
1559
查看次数

SSE比较打包无符号字节

我正在尝试使用SSE指令进行一些图像过滤.我正在使用的图像每像素有一个字节(255灰度),我需要使用比比较更好的无符号打包字节.我查看了英特尔的手册并且比较存在,但仅用于签名字节(PCMPGTB).我怎么能对无符号字节进行这种比较?提前致谢

comparison x86 unsigned sse

4
推荐指数
3
解决办法
2570
查看次数

标签 统计

c++ ×1

comparison ×1

components ×1

connector ×1

edit ×1

input ×1

java ×1

mysql ×1

sse ×1

swing ×1

unsigned ×1

x86 ×1