Java How to Program学习笔记_第十二章_GUI组件——第一部分-2(GUI Components: Part 1)

Gemini 3.1 Pro 命令行实战:终端里的代理式开发工作流 代理式开发(Agentic Coding)是一种新兴的AI编程范式,指模型在理解任务目标、上下文和工具能力基础上,自主规划、调用工具并迭代执行的闭环开发过程。其核心依赖大模型的长上下文保持、多模态理解与安全工具调用能力,技术价值在于将开发者从‘指令执行者’升级为‘目标定义者’,显著降低跨工具切换与环境配置的认知负荷。典型应用场景包括单文件Web原型生成、草图到代码的视觉语义对齐、无文档代码逆向解析,以及基于GCP等云服务的跨系统故障排查。本文聚焦 Gemini 3.1 Pro 在 CLI 环境下的真实落地, 阅读详情

 

1. JButton示例

2. 复选框示例

3. 单选按钮示例

4. 组合框示例

 

5. 列表框示例

6. 多选框示例

 

7. MouseListener and MouseMotionListener的接口方法

MouseListener and MouseMotionListener interface methods
ListenerMethods of interfaceDescription
MouseListenerpublic void mousePressed(MouseEvent event)Called when a mouse button is pressed while the mouse cursor is on a component.
MouseListenerpublic void mouseClicked(MouseEvent event)Called when a mouse button is pressed and released while the mouse cursor remains stationary on a component. Always preceded by a call to mousePressed and mouseReleased.
MouseListenerpublic void mouseReleased(MouseEvent event)Called when a mouse button is released after being pressed. Always preceded by a call to mousePressed and one or more calls to mouseDragged.
MouseListenerpublic void mouseEntered(MouseEvent event)Called when the mouse cursor enters the bounds of a component.
MouseListenerpublic void mouseExited(MouseEvent event)Called when the mouse cursor leaves the bounds of a component.
MouseMotionListenerpublic void mouseDragged(MouseEvent event)Called when the mouse button is pressed while the mouse cursor is on a component and the mouse is moved while the mouse button remains pressed. Always preceded by a call to mousePressed. All drag events are sent to the component on which the user began to drag the mouse.
MouseMotionListenerpublic void mouseMoved(MouseEvent event)Called when the mouse is moved (with no mouse buttons pressed) when the mouse cursor is on a component. All move events are sent to the component over which the mouse is currently positioned.

 8. 鼠标事件捕捉

9. 事件适配器及其实现的接口

Event-adapter classes and the interfaces they implement
Event-adapter class in java.awt.eventImplements interface
ComponentAdapter(组件适配器)ComponentListener
ContainerAdapter(容器适配器)ContainerListener
FocusAdapter(焦点适配器)FocusListener
KeyAdapter(键盘适配器)KeyListener
MouseAdapter(鼠标适配器)MouseListener
MouseMotionAdapter( 鼠标运动适配器)MouseMotionListener
WindowAdapter(窗口适配器)WindowListener

10. 鼠标点击事件捕捉

 

STM32H7B0VBT6使用Free RTOS配置SD卡+Fatfs文件管理系统 STM32H7B0VBT6使用Free RTOS配置SD卡+Fatfs文件管理系统,记录配置过程 阅读详情

相关推荐

ClearML中文文档实战:从安装到第一个实验的保姆级教程

本文提供ClearML从零开始的实战指南,涵盖核心组件理解、Python SDK安装、服务器配置及首个自动化实验的完整流程。通过改造PyTorch训练脚本的实例,详细演示了如何利用ClearML自动记录实验参数、指标与模型,实现机器学习实验的可复现性与高效管理,并简要介绍了进阶的自动化工作流。

weixin_29216049的博客 400

Java GUI:图形用户界面三剑客相比拼

进行Java GUI(Graphical User Interface,图形用户界面)编程,大家或许经常徘徊在SWT/JFACE, Swing, AWT之间选择,哪一个更合适自己?AWT作为Java语言的第一个GUI类库包,在这三者之间中年龄最长,可谓开国元勋;老二Swing,兼容AWT,同时又对AWT进行了改进,可谓站在前辈的肩膀上,自然就会看的远了;老三SWT/JFace,则只能用不走寻常路来

披着羊皮的狼的博客 1万+

UUVsimulator仿真

pub -r 10 /cmd_vel geometry_msgs/Twist控制运动没有反应。通过键盘控制运动,接收不到/cmd_vel消息。

Fatal__的博客 4617

Java How to Program习题_第十二章_GUI组件——第一部分(GUI Components: Part 1)

这章习题,除了Optional和Making Difference以外,全做完了,剩下的有空可以做做!信心是有了! Self-Review Exercises 12.1 Fill in the blanks in each of the following statements: a) Method mouseMoved is called when the mouse ...

预见未来to50的专栏 826

爬虫-Playwright逆向小红书

【代码】爬虫-Playwright逆向小红书。

weixin_44201223的博客 2445

基于Coze平台从零构建AI智能体:以测试用例生成为例的实战指南

在人工智能技术快速发展的今天,大语言模型(LLM)和提示词工程(Prompt Engineering)已成为构建智能应用的核心技术。其原理在于通过自然语言指令引导模型完成特定任务,其技术价值在于极大地降低了AI应用开发的门槛,使非专业开发者也能快速实现想法。这一技术广泛应用于自动化办公、智能客服、内容生成等场景。本文聚焦于字节跳动旗下的Coze平台,该平台通过可视化工作流编排和预置技能,将上述技术封装为易用的工具。文章以“根据产品需求文档(PRD)自动生成测试用例”这一具体场景为例,详细拆解了从需求分析、工

weixin_30617695的博客 353

Java How to Program学习笔记_章节小结——第十二章_GUI组件——第一部分(GUI Components: Part 1)

这章的内容挺多的。 Summary Section 12.1 Introduction • A graphical user interface (GUI) presents a user-friendly mechanism for interacting with an application. A GUI gives an application a distinc...

预见未来to50的专栏 405

用Python玩转Milvus:从安装SDK到完成第一个向量搜索Demo

本文为Python开发者提供了一份详细的Milvus向量数据库实战指南。文章重点讲解了如何规避版本兼容性陷阱,正确部署Milvus服务端并安装匹配的Python SDK。通过一个电影推荐系统的完整案例,演示了从数据建模、集合创建、向量插入、索引构建到执行混合搜索的全流程,帮助开发者快速上手并完成第一个向量搜索Demo。

weixin_29239279的博客 196

Java How to Program学习笔记_第十二章_GUI组件——第一部分-3(GUI Components: Part 1)

  1. inputEvent方法(判断鼠标右键和鼠标中间键是否被点击) InputEvent methods that help determine whether the right or center mouse button was clicked InputEvent method Description isMetaDown() Returns true whe...

预见未来to50的专栏 250

Linux 命令之 locale -- 设置和显示程序运行的语言环境

文章目录命令介绍locale 设置规则使用详解(一)查看当前 locale 设置(二)查看当前系统所有可用 locale(三)设置系统的 locale 命令介绍 locale 是 Linux 系统中多语言环境的设置接口,在 Linux 中,使用 locale 命令来设置和显示程序运行的语言环境,locale 会根据计算机用户所使用的语言,所在国家或者地区,以及当地的文化传统定义一个软件运行时的语言环境。 通过 locale 来设置程序运行的不同语言环境,locale 由ANSI C提供支持。locale 的

liaowenxiong的博客 3万+

【第1章>第9节】基于FPGA的图像开运算处理算法的Verilog实现

本文介绍了基于FPGA的开运算图像处理实现方法。主要内容包括:1)输入图像二值化处理,通过阈值将灰度图像转换为二值图像;2)数据缓存与窗口提取,使用寄存器数组缓存5行图像数据并构建5×5处理窗口;3)腐蚀运算逻辑,判断窗口内是否全为白色像素;4)膨胀运算逻辑,检测窗口内是否存在白色像素。最后给出了Verilog实现方案,通过级联腐蚀和膨胀模块完成开运算处理。该方法可用于FPGA图像处理算法开发。

MATLAB,verilog,python,opencv,tensorflow,caffe,C,C++ 317

Java How to Program学习笔记_第十二章_GUI组件——第一部分-1(GUI Components: Part 1)

1. Swing GUI(图形用户界面)组件示例 2. 使用JOptionPane作为输入输出界面的加法程序 3. 消息对话框中的JOptionPane静态变量 4. Swing基本GUI组件   5. 轻量级Swing组件的共同父类   6. 测试LabelFrame   7. 定位(positioning)常量   8. java.awt.event包中的一些...

预见未来to50的专栏 225

072、LLC谐振变换器的谐振电容选型

文章摘要: 本文深入探讨了LLC谐振变换器中谐振电容的选型要点。作者通过实际案例指出,谐振电容的高频特性(如ESR、ESL)会显著影响LLC性能,导致死区振铃或EMI问题。对比薄膜电容(稳定性好但体积大)和MLCC(体积小但存在直流偏置与温漂缺陷),建议100W以上优先选薄膜电容。强调需关注容值精度、耐压、纹波电流及布局对称性,避免寄生参数引发谐振异常。最后提出验证方法(热成像与波形观测)及选型清单,并分享经验:薄膜电容可靠性更优,MLCC需严格测试,布局时应缩短走线以降低环路辐射。

Jack010169的博客 243

java 按钮组,添加一个按钮组件到Java在Java标签面板

i am trying to create GUI using java swings.I am just a beginner in java swings.My primary idea was to create two tabs and add a button in one of the tabs.I wanted to write a separate class for each t...

weixin_35077079的博客 388

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

How to Use HTML in Swing Components

http://download.oracle.com/javase/tutorial/uiswing/components/html.html

不积跬步无以至千里,不积小流无以成江海。 776

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

sap for linux下载地址,How to Download sapgui for linux

Hi,As Bobby said, you need to install the SAPGUI for JAVA to access the SAP R/3 from your linux machine. The software is available in the following path,--> Installations and Upgrades--> Entry b...

weixin_42246401的博客 868

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Adding Commands to Displayable Components? @ JDJ

<!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--><script type="text/javascript"

zgqtxwd的专栏 499

Creating Components: Object Oriented, Concurrent, and Distributed Computing in Java

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.csdn.net/topmvp - topmvpProgrammers can refer to Creating Components: Object Oriented, Concurrent, and Distributed Computing in Java

TopMVP 532

AnAndroid basic components use

Android basic components use1.1Using XML-Based LayoutsWhile it is technically possible to create and attach widgets to our activity purely through Java code, the way we did in Chapter 4, the more comm

eclipseyl的专栏 406

使用Java Server Faces技术自定义组件

CUSTOM COMPONENTS WITH JAVASERVER FACES TECHNOLOGYThe March 24, 2004 Tech Tip Improving Designs With the MVC Design Pattern introduced the architectural pattern known as Model, View, Controller (MVC

北京堵车王的专栏 1351

大型CAx(CAD/CAE/CAPP/CAM)工业软件开发中的关键组件

通过对FreeCAD、SALOME等多款代码的分析研究,发现这些软件在架构设计、模块实现等方面,存在许多相似(同)的技术思想。因此,有必要对这些共性、主流的技术予以总结分析。

国产CAx(CAD/CAE/CAM)软件研发 1万+

What is the difference between AWT and SWT?

from http://www.jguru.com/faq/view.jsp?EID=507891Answer SWT (Standard Widget Toolkit) is a completely independent Graphical User Interface (GUI) toolkit from IBM. They created it for their new ecl

晏斐的Blog 1664

A good website

Documents : http://java.sun.com/docs/books/tutorial/uiswing/ This trail tells you how to create graphical user interfaces (GUIs) for applications and applets, using the Swing components. &lt;!-- ...

ladymaidu 129

GLM-5 论文理解记录

GLM-5 论文阅读记录

qq_42563807的博客 675

编译器 | 从工业实现到极简设计 —— 编译器的多元形态与实践

……

u013669912的博客 915
上一篇: Java How to Program学习笔记_第十二章_GUI组件——第一部分-1(GUI Components: Part 1)
下一篇: 学以致用——Java源码——键盘事件演示程序(Keystroke Events Demo Program)
预见未来to50
博客等级 码龄20年 6880粉丝 2788原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值