小编Sal*_*imi的帖子

尝试将hashmap值显示给另一个类中的GUI

这是问题:我想查看我的所有客户名单.因此,我将使用哈希映射并输出其ic数字及其名称.如果我尝试使用终端,输出运行正常.

但现在我想将这些哈希映射的结果输出到GUI中

到目前为止,这是我的编码.您可以跳过viewNumCust的权限操作事件.这就是我试图将haspmap输出到jtextarea的地方.

import javax.swing.*;
import java.io.*;
import java.util.*;

import java.awt.*;
import java.awt.event.*;
import java.io.FileReader;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;

public class manageClientAccGui extends JFrame
{
ImageIcon image;
JLabel imgLabel,clientLabel,helloLabel,greetingLabel;
JButton createCustProfileButt,editClientAccButt,deleteClientButt,backClientButt,viewNumCust;
JPanel panel1,panel2,panel3,panel4,panel5,panel6,panel7;
JTextArea viewListCust;

public manageClientAccGui()
{

    super("Team Garoking Manage Customer");

    Container con = getContentPane();
    con.setLayout(new BorderLayout());

    image = new ImageIcon("images/garokingLogo.jpg");
    imgLabel = new JLabel(image);

    clientLabel = new JLabel("Manage Client Account");
    clientLabel.setForeground(Color.WHITE);

    helloLabel = new JLabel("Hello! ");
    helloLabel.setForeground(Color.WHITE);

    greetingLabel = new JLabel("What would you like to do? …
Run Code Online (Sandbox Code Playgroud)

java hash user-interface swing hashmap

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

标签 统计

hash ×1

hashmap ×1

java ×1

swing ×1

user-interface ×1