小编tus*_*sya的帖子

如何检查java中字符串中有多少个字母?

如何检查Java字符串中有多少个字母?

如何检查字符串中某个位置的字母(即字符串的第二个字母)?

java string

20
推荐指数
3
解决办法
21万
查看次数

按钮逻辑被忽略 - 为什么?

我正在编写一个加密程序,它会接受常规单词并将它们转换为某个"代码".一切都已完成,但程序忽略了提交按钮代码.我该怎么做才能解决这个问题?

    import javax.swing.*;
    import java.io.*;
    import java.awt.event.*;
    import java.awt.*;
    public class decode extends JFrame {
    private JTextArea textaci;
    private JTextArea textaclr;
    private JLabel lclear;
    private JLabel lcipher;
    private JButton bsubmit;
    private String cleartext;
    private String ciphertext;
    private boolean clrtoci; 


    public decode(){
        super();
        setTitle("Decoder");
        setSize(300,200);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLayout(new GridBagLayout());
        GridBagConstraints c =new GridBagConstraints();
        c.fill=GridBagConstraints.VERTICAL;
        c.weightx=0.5;
        textaci=new JTextArea();
        textaclr=new JTextArea();
        lclear=new JLabel("cleartext:");
        lcipher=new JLabel("ciphertext:");
        bsubmit=new JButton("Submit");
        bsubmit.setActionCommand("enable");
        textaci.setEditable(true);
        textaci.setLineWrap(true);
        textaclr.setEditable(true);
        textaclr.setLineWrap(true);
        textaci.setText(ciphertext);
        c.gridx=0;
        c.gridy=0;
        add(lclear);
        c.gridx=1;
        c.gridy=0;
        add(textaclr);

        c.gridx=0;
        c.gridy=2;
        add(lcipher);
        c.gridx=3;
        c.gridy=4; …
Run Code Online (Sandbox Code Playgroud)

java swing jbutton

0
推荐指数
1
解决办法
193
查看次数

如何使字符串"闪烁"?

我并不是说只是出现和消失.我的意思是快速闪烁,毫秒速度.有任何想法吗?

java string swing

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

标签 统计

java ×3

string ×2

swing ×2

jbutton ×1