1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

サンプル

Last updated at Posted at 2021-09-09

hoge

関数

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LogWindowExample {
    private JFrame frame;
    private JTextArea logArea;
    private JButton logButton;

    public LogWindowExample() {
        // フレームの設定
        frame = new JFrame("ログウィンドウ");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 300);

        // テキストエリアの設定
        logArea = new JTextArea();
        logArea.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(logArea);
        frame.add(scrollPane, BorderLayout.CENTER);

        // ボタンの設定
        logButton = new JButton("ログを追加");
        logButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                addLog("これはログメッセージです");
            }
        });
        frame.add(logButton, BorderLayout.SOUTH);

        // フレームを表示
        frame.setVisible(true);
    }

    // ログをテキストエリアに追加するメソッド
    private void addLog(String message) {
        logArea.append(message + "\n");
    }

    public static void main(String[] args) {
        // EDT (Event Dispatch Thread)でGUIを初期化
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new LogWindowExample();
            }
        });
    }
}


CheckJyoken.vb
Option Explicit

Private chekString01

Private chekString02

Private chekString03

Function getChekString01() As String
    getChekString01 = chekString01
End Function

Sub setChekString01(value As String)
    chekString01 = value
End Sub

Function getChekString02() As String
    getChekString02 = chekString02
End Function

Sub setChekString02(value As String)
    chekString02 = value
End Sub

Function getChekString03() As String
    getChekString03 = chekString03
End Function

Sub setChekString03(value As String)
    chekString03 = value
End Sub
1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?