小编Shu*_*uyi的帖子

如何从另一个面板更改卡布局面板?

我用Google搜索了很多内容,但没有找到解决方案.我想应该有java大师来帮助我...

这是我的初始化方法:


private void initialize() {
    this.setSize(750, 480);
    this.setContentPane(getJContentPane());
    this.setTitle("Registration");
    JPanel topPane = new TopPane();
    this.getContentPane().add(topPane,BorderLayout.PAGE_START);
    cards=new JPanel(new CardLayout());
    cards.add(step0(),"step0");
    cards.add(step1(),"step1");
    cards.add(step2(),"step2");
    this.getContentPane().add(cards,BorderLayout.CENTER);
}

public JPanel step2(){
    EnumMap<DPFPFingerIndex,DPFPTemplate> template = new EnumMap<DPFPFingerIndex, DPFPTemplate>(DPFPFingerIndex.class); 
    JPanel enrol = new Enrollment(template,2);
    return enrol;
}

public JPanel step0(){
    JPanel userAgree = new UserAgreement();
    return userAgree;
}

public JPanel step1(){
    JPanel userInfo = new UserInformation();
    return userInfo;
}

public JPanel getCards(){
    return cards;
}
Run Code Online (Sandbox Code Playgroud)

这是另一个步骤0 JPanel的方法:

jButtonAgree.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent e) {
                Registration …
Run Code Online (Sandbox Code Playgroud)

java layout swing cardlayout

11
推荐指数
1
解决办法
7615
查看次数

github 操作 - 无法连接到 mysql

所以我正在尝试使用 github 操作设置 Laravel ci 服务器。而且,我edbizarro/gitlab-ci-pipeline-php:7.3用作我的容器,我使用官方的 mariadb docker 作为 mysql 服务。:

services:
      mysql:
        image: mariadb:10.3
        env:
          MYSQL_USER: root
          MYSQL_PASSWORD: root
          MYSQL_ROOT_PASSWORD: root
        ports:
          - 13306:3306 
...
Run Code Online (Sandbox Code Playgroud)

我正在尝试运行,运行 mysql 命令来导入数据库:

  - name: Setting Up DB
        run: |
          mysql -Tv -h mysql -P 13306 --protocol=tcp -u root -proot < ./storage/test.sql
Run Code Online (Sandbox Code Playgroud)

这是我所做的几次尝试:

| host               | error message                                                          |
|--------------------|------------------------------------------------------------------------|
| mysql,"${DB_HOST}" | ERROR 2005 (HY000): Unknown MySQL server host 'mysql' (-2)             |
| 0.0.0.0            | ERROR 2002 (HY000): Can't connect to …
Run Code Online (Sandbox Code Playgroud)

github mariadb docker github-actions

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

Java AES 256安全密钥生成器 - 密钥大小非法

我正在尝试生成加密密钥:

public static final String ENCYT_ALGORITHM = "AES/ECB/PKCS7Padding";
public static final String KEY_ALGORITHM = "PBEWITHSHA256AND256BITAES-CBC-BC" ;
//BENCYT_ALGORITHMSE64Encoder encod = new BENCYT_ALGORITHMSE64Encoder();
//BENCYT_ALGORITHMSE64Decoder decod = new BENCYT_ALGORITHMSE64Decoder();

public Encryption(String preMaster,String text,int x){      
    this.preMaster=preMaster;       
    this.text=text.getBytes();
}
public void keyGenerator(){
    KeyGenerator kg = null;
    try {
        kg = KeyGenerator.getInstance("AES");
        secret = kg.generateKey();
    } catch (Exception e) {
        // TODO ENCYT_ALGORITHMuto-generated catch block
        e.printStackTrace();
    }

}

public String preMaster() {

    byte[] keys = null;
    keys = preMaster.getBytes();
    int x = -1;
    int process = …
Run Code Online (Sandbox Code Playgroud)

java bouncycastle aes

2
推荐指数
1
解决办法
6915
查看次数