没有合适的资源?快使用搜索试试~ 我知道了~
首页Java APIs, Extensions and Libraries, 2nd Edition--2018
Java APIs, Extensions and Libraries, 2nd Edition--2018
需积分: 6 7 下载量 78 浏览量
更新于2023-05-26
收藏 9.68MB PDF 举报
Extend your Java skills beyond the fundamental object-oriented concepts and core language features Apply Java Swing for building Java front ends Get started with Java network programming Connect to databases and access data from Java programs using the JDBC API Work with JavaFX, RMI (Remote Method Invocation), and JNI (Java Native Interface) Use the new scripting features of Java
资源详情
资源推荐
Java APIs, Extensions and Libraries: With JavaFX, JDBC, jmod, jlink, Networking, and the Process API
Kishori Sharan
Montgomery, Alabama, USA
ISBN-13 (pbk): 978-1-4842-3545-4 ISBN-13 (electronic): 978-1-4842-3546-1
https://doi.org/10.1007/978-1-4842-3546-1
Library of Congress Control Number: 2018939410
Copyright © 2018 by Kishori Sharan
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage
and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or
hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material
contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc).
SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail editorial@apress.com; for reprint, paperback, or audio
rights, please email bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web
page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to readers
on GitHub via the book’s product page, located at www.apress.com/9781484235454. For more detailed
information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
www.allitebooks.com
iii
Contents
About the Author ���������������������������������������������������������������������������������������������������xvii
About the Technical Reviewer ��������������������������������������������������������������������������������xix
Acknowledgments ��������������������������������������������������������������������������������������������������xxi
Introduction ����������������������������������������������������������������������������������������������������������xxiii
■Chapter 1: Introduction to Swing �������������������������������������������������������������������������� 1
What Is Swing? ���������������������������������������������������������������������������������������������������������������� 2
The Simplest Swing Program ������������������������������������������������������������������������������������������� 3
Components of a JFrame ������������������������������������������������������������������������������������������������� 7
Adding Components to a JFrame ������������������������������������������������������������������������������������� 9
Some Utility Classes ������������������������������������������������������������������������������������������������������� 13
The Point Class ������������������������������������������������������������������������������������������������������������������������������������� 13
The Dimension Class ���������������������������������������������������������������������������������������������������������������������������� 13
The Insets Class ������������������������������������������������������������������������������������������������������������������������������������ 14
The Rectangle Class ����������������������������������������������������������������������������������������������������������������������������� 14
Layout Managers ������������������������������������������������������������������������������������������������������������ 15
FlowLayout �������������������������������������������������������������������������������������������������������������������������������������������16
BorderLayout ����������������������������������������������������������������������������������������������������������������������������������������21
CardLayout��������������������������������������������������������������������������������������������������������������������������������������������24
BoxLayout ��������������������������������������������������������������������������������������������������������������������������������������������� 26
GridLayout �������������������������������������������������������������������������������������������������������������������������������������������� 31
GridBagLayout �������������������������������������������������������������������������������������������������������������������������������������� 33
SpringLayout ���������������������������������������������������������������������������������������������������������������������������������������� 51
GroupLayout ����������������������������������������������������������������������������������������������������������������������������������������� 59
The null Layout Manager ���������������������������������������������������������������������������������������������������������������������� 68
www.allitebooks.com
■ Contents
iv
Creating a Reusable JFrame ������������������������������������������������������������������������������������������ 70
Event Handling ��������������������������������������������������������������������������������������������������������������� 72
Handling Mouse Events �������������������������������������������������������������������������������������������������� 79
Summary ������������������������������������������������������������������������������������������������������������������������ 82
■Chapter 2: Swing Components ���������������������������������������������������������������������������� 85
What Is a Swing Component? ���������������������������������������������������������������������������������������� 85
JButton ��������������������������������������������������������������������������������������������������������������������������� 90
JPanel����������������������������������������������������������������������������������������������������������������������������� 95
JLabel ����������������������������������������������������������������������������������������������������������������������������� 96
Text Components ������������������������������������������������������������������������������������������������������������ 97
JTextComponent ��������������������������������������������������������������������������������������������������������������������������������� 100
JTextField�������������������������������������������������������������������������������������������������������������������������������������������� 102
JPasswordField ����������������������������������������������������������������������������������������������������������������������������������107
JFormattedTextField ��������������������������������������������������������������������������������������������������������������������������� 108
JTextArea �������������������������������������������������������������������������������������������������������������������������������������������� 111
JEditorPane ���������������������������������������������������������������������������������������������������������������������������������������� 114
JTextPane ������������������������������������������������������������������������������������������������������������������������������������������� 119
Validating Text Input ����������������������������������������������������������������������������������������������������� 127
Making Choices ������������������������������������������������������������������������������������������������������������ 128
JSpinner ����������������������������������������������������������������������������������������������������������������������� 137
JScrollBar ��������������������������������������������������������������������������������������������������������������������� 139
JScrollPane ������������������������������������������������������������������������������������������������������������������ 140
JProgressBar ���������������������������������������������������������������������������������������������������������������� 142
JSlider �������������������������������������������������������������������������������������������������������������������������� 143
JSeparator �������������������������������������������������������������������������������������������������������������������� 145
Menus��������������������������������������������������������������������������������������������������������������������������� 145
JToolBar������������������������������������������������������������������������������������������������������������������������ 153
JToolBar Meets the Action Interface ����������������������������������������������������������������������������� 156
JTable ��������������������������������������������������������������������������������������������������������������������������� 157
www.allitebooks.com
剩余825页未读,继续阅读
白鸽-小蛋
- 粉丝: 10
- 资源: 167
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- BSC关键绩效财务与客户指标详解
- 绘制企业战略地图:从财务到客户价值的六步法
- BSC关键绩效指标详解:财务与运营效率评估
- 手持移动数据终端:常见问题与WIFI设置指南
- 平衡计分卡(BSC):绩效管理与战略实施工具
- ESP8266智能家居控制系统设计与实现
- ESP8266在智能家居中的应用——网络家电控制系统
- BSC:平衡计分卡在绩效管理与信息技术中的应用
- 手持移动数据终端:常见问题与解决办法
- BSC模板:四大领域关键绩效指标详解(财务、客户、运营与成长)
- BSC:从绩效考核到计算机网络的关键概念
- BSC模板:四大维度关键绩效指标详解与预算达成分析
- 平衡计分卡(BSC):绩效考核与战略实施工具
- K-means聚类算法详解及其优缺点
- 平衡计分卡(BSC):从绩效考核到战略实施
- BSC:平衡计分卡与计算机网络中的应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功