QT 基本对话框

news2024/10/5 14:07:45

包括:

1.标准文件对话框

 

 dialog.h

#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QTextCodec>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QGridLayout>
#include <QFrame>
#include "inputdlg.h"
#include "msgboxdlg.h"
class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);

    ~Dialog();
private:
    //标准文件对话框实例
    QPushButton *btnfile;
    QLineEdit *linefile;
    QGridLayout *mainLayout;

    //标准颜色对话框
    QPushButton *btncolor;
    QFrame *framecolor;

    //标准字体对话框
    QPushButton *btnfont;
    QLineEdit *linefont;

    //标准输入对话框
    QPushButton *btninput;
    InputDlg *Dlginput;

    //标准消息对话框
    QPushButton  *btnMsg;
    MsgBoxDlg   *Dlgmsg;


    //自定义消息对话框
    QPushButton  *btnCustom;
    QLabel   *label;

private slots:
    void  showFile();
    void  showColor();
    void  showFont();
    void  showInputDlg();
    void  showMsgDlg();
    void  showCustomDlg();

};
#endif // DIALOG_H

dialog.cpp

#include "dialog.h"
#include <QString>
#include <QFileDialog>
#include <QColorDialog>
#include <QFontDialog>
#include <QDebug>
#include <QMessageBox>
Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
{
    setWindowTitle(QStringLiteral("各种标准对话框的实例"));
//标准文件对话框实例
    btnfile=new QPushButton;
    btnfile->setText(QStringLiteral("文件标准对话框"));
    linefile=new QLineEdit;

//标准颜色对话框
    btncolor=new QPushButton;
    btncolor->setText(QStringLiteral("颜色标准对话框"));
    framecolor=new QFrame;
    framecolor->setFrameShape(QFrame::Box);
    framecolor->setAutoFillBackground(true);

//标准字体对话框
    btnfont=new QPushButton;
    btnfont->setText(QStringLiteral("字体标准对话框"));
    linefont=new QLineEdit;
    linefont->setText(QStringLiteral("Welcome"));

//标准输入对话框
    btninput=new QPushButton;
    btninput->setText(QStringLiteral("输入标准对话框"));

//标准消息对话框
    btnMsg=new QPushButton;
    btnMsg->setText(QStringLiteral("输入消息对话框"));

//自定义消息对话框
    btnCustom=new QPushButton;
    btnCustom->setText(QStringLiteral("用户自定义消息对话框"));
    label=new QLabel;
    label->setFrameStyle(QFrame::Panel|QFrame::Sunken);


    //布局
    mainLayout =new  QGridLayout(this);
    mainLayout->addWidget(btnfile,0,0);
    mainLayout->addWidget(linefile,0,1);

    mainLayout->addWidget(btncolor,1,0);
    mainLayout->addWidget(framecolor,1,1);

    mainLayout->addWidget(btnfont,2,0);
    mainLayout->addWidget(linefont,2,1);

    mainLayout->addWidget(btninput,3,0);
    mainLayout->addWidget(btnMsg,3,1);

    mainLayout->addWidget(btnCustom,4,0);
    mainLayout->addWidget(label,4,1);

    //添加信号与槽
    connect(btnfile,SIGNAL(clicked()),this,SLOT(showFile()));//文件
    connect(btncolor,SIGNAL(clicked()),this,SLOT(showColor()));//颜色
    connect(btnfont,SIGNAL(clicked()),this,SLOT(showFont()));//字体
    connect(btninput,SIGNAL(clicked()),this,SLOT(showInputDlg()));//输入????用qDebug调试一下,你来、
    connect(btnMsg,SIGNAL(clicked()),this,SLOT(showMsgDlg()));//消息
    connect(btnCustom,SIGNAL(clicked()),this,SLOT(showCustomDlg()));//消息

}

Dialog::~Dialog()
{
}

//标准文件对话框实例
void Dialog::showFile()
{
   QString s=QFileDialog::getOpenFileName(this,"open file dialog","/","c++ files(*.cpp)::c files(*.c)::Head files(*.h)");
   linefile->setText(s);
}



//标准颜色对话框
void Dialog::showColor()
{
    QColor c =QColorDialog::getColor(Qt::blue);
    if(c.isValid())
    {
        framecolor->setPalette(QPalette(c));
    }
}

//标准字体对话框
void Dialog::showFont()
{
    bool ok;
    QFont f=QFontDialog::getFont(&ok);
    if(ok)
    {
      linefont->setFont(f);
    }

}

//输入标准对话框
void Dialog::showInputDlg()
{
    Dlginput=new InputDlg(this);//this啥意思,你这个是弹窗,不是替换原有界面,this删掉
    Dlginput->show();//????
    qDebug()<<"hhhhhh"<<endl;//下次注意-能进去,说明你这个弹窗不对劲
}

void Dialog::showMsgDlg()
{
    Dlgmsg=new MsgBoxDlg();
    Dlgmsg->show();


}

//用户自定义消息框
void Dialog::showCustomDlg()
{
    label->setText(QStringLiteral("Custom Message Box"));
    QMessageBox customMsgBox;
    customMsgBox.setWindowTitle(QStringLiteral("用户自定义消息框"));

    QPushButton *yesBtn=customMsgBox.addButton(QStringLiteral("Yes"),QMessageBox::ActionRole);
    QPushButton *noBtn=customMsgBox.addButton(QStringLiteral("No"),QMessageBox::ActionRole);
    QPushButton *cancelBtn=customMsgBox.addButton(QMessageBox::Cancel);

    customMsgBox.setText(QStringLiteral("这是一个用户自定义消息框"));
    customMsgBox.setIconPixmap(QPixmap("Qt.png"));
    customMsgBox.exec();

    if(customMsgBox.clickedButton()==yesBtn)
       label->setText(QStringLiteral("Custom Message Box/Yes"));
    if(customMsgBox.clickedButton()==noBtn)
       label->setText(QStringLiteral("Custom Message Box/No"));
    if(customMsgBox.clickedButton()==cancelBtn)
       label->setText(QStringLiteral("Custom Message Box/Cancel"));

    return;
}

2.标准颜色对话框

 3.标准字体对话框

 4.标准输入对话框

4.1标准字符串输入对话框

 

4.2标准条目选择对话框

4.3标准int类型输入对话框

4.4标准double类型输入对话框

 inputdlg.h

#ifndef INPUTDLG_H
#define INPUTDLG_H

#include <QObject>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QGridLayout>
#include <QDialog>
#include <QWidget>

class InputDlg : public QDialog
{
    Q_OBJECT
public:
    explicit InputDlg(QWidget *parent = nullptr);

signals:

private slots:
    void  ChangeName();
    void  ChangeSex();
    void  ChangeAge();
    void  ChangeScore();

private:
    QLabel *labname1;
    QLabel *labsex1;
    QLabel *labage1;
    QLabel *labscore1;
    QLabel *labname2;
    QLabel *labsex2;
    QLabel *labage2;
    QLabel *labscore2;

    QPushButton  *btnname;
    QPushButton  *btnsex;
    QPushButton  *btnage;
    QPushButton  *btnscore;
    QGridLayout  *mainLayout;
};

#endif // INPUTDLG_H

 inputdlg.cpp

#include "inputdlg.h"
#include <QString>
#include <QWidget>
#include <QGridLayout>
#include <QInputDialog>
InputDlg::InputDlg(QWidget *parent) : QDialog(parent)
{
   setWindowTitle(QStringLiteral("各种标准对话框的实例"));
   labname1=new QLabel;
   labname1->setText(QStringLiteral("姓名"));
   labname2=new QLabel;
   labname2->setText(QStringLiteral("张三"));
   labname2->setFrameStyle(QFrame::Panel|QFrame::Sunken);
   btnname=new QPushButton;
   btnname->setText(QStringLiteral("修改姓名"));

    labsex1=new QLabel;
    labsex1->setText(QStringLiteral("性别"));
    labsex2=new QLabel;
    labsex2->setText(QStringLiteral("男"));
    labsex2->setFrameStyle(QFrame::Panel|QFrame::Sunken);
    btnsex=new QPushButton;
    btnsex->setText(QStringLiteral("修改性别"));

    labage1=new QLabel;
    labage1->setText(QStringLiteral("年龄"));
    labage2=new QLabel;
    labage2->setText(QStringLiteral("21"));
    labage2->setFrameStyle(QFrame::Panel|QFrame::Sunken);
    btnage=new QPushButton;
    btnage->setText(QStringLiteral("修改年龄"));

    labscore1=new QLabel;
    labscore1->setText(QStringLiteral("成绩"));
    labscore2=new QLabel;
    labscore2->setText(QStringLiteral("98"));
    labscore2->setFrameStyle(QFrame::Panel|QFrame::Sunken);
    btnscore=new QPushButton;
    btnscore->setText(QStringLiteral("修改成绩"));


    //布局“QGridLayout::QGridLayout(const QGridLayout &)”: 无法将参数 1 从“InputDlg *”转换为“QWidget *” ---说明QObject不能实现
    mainLayout =new  QGridLayout(this);
    mainLayout->addWidget(labname1,0,0);
    mainLayout->addWidget(labname2,0,1);
    mainLayout->addWidget(btnname,0,2);

    mainLayout->addWidget(labsex1,1,0);
    mainLayout->addWidget(labsex2,1,1);
    mainLayout->addWidget(btnsex,1,2);

    mainLayout->addWidget(labage1,2,0);
    mainLayout->addWidget(labage2,2,1);
    mainLayout->addWidget(btnage,2,2);

    mainLayout->addWidget(labscore1,3,0);
    mainLayout->addWidget(labscore2,3,1);
    mainLayout->addWidget(btnscore,3,2);
    mainLayout->setMargin(15);
    mainLayout->setSpacing(10);

//信号与槽的连接
    connect(btnname,SIGNAL(clicked()),this,SLOT(ChangeName()));
    connect(btnsex,SIGNAL(clicked()),this,SLOT(ChangeSex()));
    connect(btnage,SIGNAL(clicked()),this,SLOT(ChangeAge()));
    connect(btnscore,SIGNAL(clicked()),this,SLOT(ChangeScore()));

}

void InputDlg::ChangeName()
{
    bool ok;
    QString  text=QInputDialog::getText(this,QStringLiteral("标准字符串"),QStringLiteral("请输入姓名:"),QLineEdit::Normal,labname2->text(),&ok);
    if(ok&&!text.isEmpty())
    {
       labname2->setText(text);
    }
}

void InputDlg::ChangeSex()
{
    QStringList SexItems;
    SexItems<<QStringLiteral("男")<<QStringLiteral("女");
    bool ok;
    QString SexItem=QInputDialog::getItem(this,QStringLiteral("标准条目选择对话框"),QStringLiteral("请选择性别:"),SexItems,0,false,&ok);
    if(ok&&!SexItem.isEmpty())
    {
       labsex2->setText(SexItem);
    }

}

void InputDlg::ChangeAge()
{
   bool ok;
   int age=QInputDialog::getInt(this,QStringLiteral("标准int类型输入话框"),QStringLiteral("请选择年龄:"),labage2->text().toInt(&ok),0,100,1,&ok);
   if(ok)
   {
      labsex2->setText(QString(QStringLiteral("%1")).arg(age));
   }

}

void InputDlg::ChangeScore()
{
    bool ok;
    double score=QInputDialog::getDouble(this,QStringLiteral("标准double类型输入话框"),QStringLiteral("请输入成绩:"),labscore2->text().toDouble(&ok),0,100,1,&ok);
    if(ok)
    {
       labscore2->setText(QString(QStringLiteral("%1")).arg(score));
    }
}

5.消息对话框

5.1Question 消息框

5.2Information 消息框

 

5.3Warning 消息框

5.4Critical 消息框

5.5About 消息框

5.6About  Qt 消息框

 msgboxdlg.h

#ifndef MSGBOXDLG_H
#define MSGBOXDLG_H
#include <QWidget>
#include <QTextCodec>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QGridLayout>
class MsgBoxDlg : public QWidget
{
    Q_OBJECT
public:
    explicit MsgBoxDlg(QWidget *parent = nullptr);

signals:
private:
     QLabel *label;
     QPushButton  *btnquestion;
     QPushButton  *btninformation;
     QPushButton  *btnwarning;
     QPushButton  *btncritical;
     QPushButton  *btnabout;
     QPushButton  *btnQtabout;
     QGridLayout  *mainLayout;

private slots:
    void  showQuestionMsg();
    void  showInformationMsg();
    void  showWarningMSg();
    void  showCriticalMsg();
    void  showAboutMsg();
    void  showAboutQtMsg();

};

#endif // MSGBOXDLG_H

 msgboxdlg.cpp

#include "msgboxdlg.h"
#include <QMessageBox>
MsgBoxDlg::MsgBoxDlg(QWidget *parent) : QWidget(parent)
{

    setWindowTitle(QStringLiteral("标准消息对话框实例"));
    label=new QLabel;
    label->setText(QStringLiteral("请选择一种消息框"));

    btnquestion=new QPushButton;
    btnquestion->setText(QStringLiteral("QuestionMSg"));

    btninformation=new QPushButton;
    btninformation->setText(QStringLiteral("InformationMSg"));

    btnwarning=new QPushButton;
    btnwarning->setText(QStringLiteral("WarningMSg"));

    btncritical=new QPushButton;
    btncritical->setText(QStringLiteral("CriticalMSg"));

    btnabout=new QPushButton;
    btnabout->setText(QStringLiteral("AboutMSg"));

    btnQtabout=new QPushButton;
    btnQtabout->setText(QStringLiteral("AboutQtMSg"));


    //布局

    mainLayout =new  QGridLayout(this);
    mainLayout->addWidget(label,0,0,1,2);
    mainLayout->addWidget(btnquestion,1,0);

    mainLayout->addWidget(btninformation,1,1);
    mainLayout->addWidget(btnwarning,2,0);

    mainLayout->addWidget(btncritical,2,1);
    mainLayout->addWidget(btnabout,3,0);

    mainLayout->addWidget(btnQtabout,3,1);

//信号与槽
    connect(btnquestion,&QPushButton::clicked,[this](){showQuestionMsg();});
    connect(btninformation,&QPushButton::clicked,[this](){showInformationMsg();});
    connect(btnwarning,&QPushButton::clicked,[this](){showWarningMSg();});
    connect(btncritical,&QPushButton::clicked,[this](){showCriticalMsg();});
    connect(btnabout,&QPushButton::clicked,[this](){showAboutMsg();});
    connect(btnQtabout,&QPushButton::clicked,[this](){showAboutQtMsg();});

}

void MsgBoxDlg::showQuestionMsg()
{
    label->setText(QStringLiteral("QUestion Message Box"));
    switch(QMessageBox::question(this,QStringLiteral("Question消息框"),QStringLiteral("您现在已经修改完成,是否要结束程序"),QMessageBox::Ok|QMessageBox::Cancel,QMessageBox::Ok))
    {
    case QMessageBox::Ok:
        label->setText(QStringLiteral("Question button/ok"));
        break;
    case QMessageBox::Cancel:
        label->setText(QStringLiteral("Question button/Cancel"));
        break;
    default:
        break;
    }
   return;

}

void MsgBoxDlg::showInformationMsg()
{
    label->setText(QStringLiteral("Information Message Box"));
    QMessageBox::information(this,QStringLiteral("Information消息框"),QStringLiteral("这是Information消息对话框,欢迎您!"));
        return;
}

void MsgBoxDlg::showWarningMSg()
{
    label->setText(QStringLiteral("Warning Message Box"));
    switch(QMessageBox::warning(this,QStringLiteral("Warning消息框"),QStringLiteral("您修改的内容还没有保存,是否保存对文档的修改?"),QMessageBox::Save|QMessageBox::Discard|QMessageBox::Cancel,QMessageBox::Save))
    {
    case QMessageBox::Save:
        label->setText(QStringLiteral("Warning button/Save"));
        break;
    case QMessageBox::Cancel:
        label->setText(QStringLiteral("Warning button/Cancel"));
        break;
    case QMessageBox::Discard:
        label->setText(QStringLiteral("Warning button/Discard"));
        break;

    default:
        break;
    }
   return;
}

void MsgBoxDlg::showCriticalMsg()
{
    label->setText(QStringLiteral("Critical Message Box"));
    QMessageBox::critical(this,QStringLiteral("Critical消息框"),QStringLiteral("这是Critical消息对话框测试!"));
        return;
}

void MsgBoxDlg::showAboutMsg()
{
    label->setText(QStringLiteral("About Message Box"));
    QMessageBox::about(this,QStringLiteral("About消息框"),QStringLiteral("这是About消息对话框测试!"));
        return;
}

void MsgBoxDlg::showAboutQtMsg()
{
    label->setText(QStringLiteral("About Qt Message Box"));
    QMessageBox::aboutQt(this,QStringLiteral("About Qt消息框"));
        return;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/905145.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Vscode详细安装教程

Vscode官网下载 官网地址&#xff1a;Download Visual Studio Code - Mac, Linux, Windows 通过链接可以直接跳转到下面的页面当中&#xff0c;支持的版本有Windows、Linux、Mac&#xff0c;可以选择适配自己电脑的版本&#xff0c;一般来说应该是Windows x64的。不要直接点W…

C++图形界面编程-MFC

C控制台程序是命令行黑框&#xff0c;如果要写一个图形界面&#xff0c;VS也提供了图形界面编程MFC。建项目的时候选如下选项&#xff1a; 类似于QT。 问&#xff1a;那么MFC项目的运行入口main()或WinMain()在哪里呢&#xff1f; 答&#xff1a;其实&#xff0c;在MFC应用程…

Kubernetes 使用 Rancher 管理

K8S集群管理工具 只能管理单个K8S集群 kubectl命令行管理工具 dashboard&#xff08;K8S官方的UI界面图形化管理工具&#xff09; &#xff08;管理多集群很麻烦&#xff0c;切换不同集群每次需要更改kube-config文件[kubectl配置文件]&#xff0c;如果kubeadm部署每次都需…

字符设备驱动实例(PWM和RTC)

目录 五、PWM 六、RTC 五、PWM PWM(Pulse Width Modulation&#xff0c;脉宽调制器)&#xff0c;顾名思义就是一个输出脉冲宽度可以调整的硬件器件&#xff0c;其实它不仅脉冲宽度可调&#xff0c;频率也可以调整。它的核心部件是一个硬件定时器&#xff0c;其工作原理可以用…

15.配置资源管理

文章目录 配置资源管理Secret陈述式创建声明式创建存储卷挂载变量引用创建tls类型创建dockerconfigjson类型安装docker&#xff0c;创建 harbor仓库pod节点设置 ConfigMap创建挂载目录挂载文件以环境变量引用通过打补丁的方式修改配置 总结 配置资源管理 Secret Secret 是用来…

项目实战 — 博客系统③ {功能实现}

目录 一、编写注册功能 &#x1f345; 1、使用ajax构造请求&#xff08;前端&#xff09; &#x1f345; 2、统一处理 &#x1f384; 统一对象处理 &#x1f384; 保底统一返回处理 &#x1f384; 统一异常处理 &#x1f345; 3、处理请求 二、编写登录功能 &#x1f345; …

Android 10.0 SystemServer进程读写sdcard权限的修改

1.前言 在10.0的系统开发中,在一些系统进程中,也就是在SystemServer的进程中,其中系统服务中会要求读写Sdcard的一些功能,然后 默认是没有读取sdcard权限的,而在app中可以申请sdcard读写权限在系统服务中就不能申请权限,接下来看怎么授权实现sdcard授权 如图: 2.Sy…

计算机网络(9) --- 数据链路层与MAC帧

计算机网络&#xff08;8&#xff09; --- IP与IP协议_哈里沃克的博客-CSDN博客IP与IP协议https://blog.csdn.net/m0_63488627/article/details/132155460?spm1001.2014.3001.5502 目录 1.MAC帧 1.MAC地址 2.MAC帧报头 3.资源碰撞 4.MTU 1.对IP协议的影响 2.对UDP协议…

【docker】基于dockerfile编写LNMP

目录 一、基础环境准备 二、部署nginx&#xff08;容器IP为172.18.0.10&#xff09; 1、整个Dockerfile文件内容 2、配置nginx.conf文件 3、构建镜像 ​编辑 三、部署mysql 1、整个Docker文件内容 2、准备my.conf文件 3、生成镜像 4、启动镜像容器 5、验证mysql 四、PH…

视频局部区域移动检测, 删除相似帧

视频局部区域移动检测, 删除相似帧 完整方案在本文最后, 不想听故事的直接跳转到完整方案即可 起因 老板的一个东西找不到了, 让查监控 场景 东西放在一个架子上, 由一个海康威视全天候录像的摄像头监控, 但是巧就巧在这个要找的东西被放在了摄像头的死角里, 正好被柜子的隔…

nginx crlf+xss漏洞组合拳

1.crlf漏洞概述 CRLF是指回车和换行符的组合&#xff0c;它们的十六进制编码分别为0x0d和0x0a。在HTTP协议中&#xff0c;HTTP头和HTTP正文之间使用两个CRLF来进行分隔。如果攻击者能够注入恶意的换行符&#xff0c;就能够向HTTP消息中插入恶意的代码或会话Cookie。CRLF漏洞通常…

Redis是如何保证高可用的?

Redis这种基于内存的关系型数据库我们在选用的时候就是考虑到它的快。而且可以很方便的实现诸如分布式锁、消息队列等功能。 笔者在前一段秋招面试的时候就被提问&#xff0c;“Redis是怎么保证高可用的&#xff1f;” 后续的子问题包含&#xff0c;集群模式是怎么实现的&…

HTTP连接管理

基础知识&#xff1a;非持久连接 HTTP初始时1.0版本在浏览器每一次向服务器请求完资源都会立即断开TCP连接&#xff0c;如果想要请求多个资源&#xff0c;就必须建立多个连接&#xff0c;这就导致了服务端和客户端维护连接的开销。 例如&#xff1a;一个网页中包含文字资源也包…

1、攻防世界第一天

1、网站目录下会有一个robots.txt文件&#xff0c;规定爬虫可以/不可以爬取的网站。 2、URL编码细则&#xff1a;URL栏中字符若出现非ASCII字符&#xff0c;则对其进行URL编码&#xff0c;浏览器将该请求发给服务端&#xff1b;服务端会可能会先对收到的url进行解码&#xff0…

完全二叉树O(1)插入

919. 完全二叉树插入器 - 力扣&#xff08;LeetCode&#xff09; 完全二叉树 是每一层&#xff08;除最后一层外&#xff09;都是完全填充&#xff08;即&#xff0c;节点数达到最大&#xff09;的&#xff0c;并且所有的节点都尽可能地集中在左侧。 设计一种算法&#xff0c…

日志系统——日志落地模块设计

一&#xff0c;大致框架 首先我们需要明确模块的功能&#xff0c;将格式化后的日志信息字符串&#xff0c;输出到对应的位置。同时由于用户输出信息的方式是多样的&#xff0c;因此我们日志落地模块也支持拓展的功能&#xff0c;也就是用户自定义落地方式。 日志信息落地的方式…

vite打包遇到的错误

1.js emit is not supported 2.将package.json中的bulid后面写成“vue-tsc --noEmit --skipLibCheck && vite build” 3.再次打包成功

设计模式——接口隔离原则

文章目录 基本介绍应用实例应传统方法的问题和使用接口隔离原则改进 基本介绍 客户端不应该依赖它不需要的接口&#xff0c;即一个类对另一个类的依赖应该建立在最小的接口上先看一张图: 类 A 通过接口 Interface1 依赖类 B&#xff0c;类 C 通过接口 Interface1 依赖类 D&…

四、性能监控工具nmon,severAgent

简单的性能监控工具 一、 性能监控概括二、 常用的性能监控工具1、nmon概况nmon有三种运行模式&#xff1a;nmon的使用 2、SeverAgent安装步骤集成jmeter注意点特点 一、 性能监控概括 性能测试工具&#xff1a; 用什么工具来做性能测试性能测试场景设计&#xff1a; 用什么方法…

VisualVM(All-in-One Java Troubleshooting Tool)多合-故障处理工具

VisualVM&#xff1a;多合-故障处理工具 VisualVM&#xff08;All-in-One Java Troubleshooting Tool&#xff09;是功能最强大的 运行监视 和 故障处理 程序之一&#xff0c;曾经在很长一段时间内是Oracle官方主力发展的虚拟机故障处理工具。Oracle曾在VisualVM的软件说明中写…