Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
zetcode-zh
提交
bcb9869a
Z
zetcode-zh
项目概览
OpenDocCN
/
zetcode-zh
8 个月 前同步成功
通知
2
Star
157
Fork
40
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zetcode-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bcb9869a
编写于
6月 22, 2020
作者:
W
wizardforcel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2020-06-22 10:19:16
上级
84fdb3d5
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
60 addition
and
60 deletion
+60
-60
docs/gui/63.md
docs/gui/63.md
+4
-4
docs/gui/64.md
docs/gui/64.md
+5
-5
docs/gui/65.md
docs/gui/65.md
+1
-1
docs/gui/66.md
docs/gui/66.md
+1
-1
docs/gui/67.md
docs/gui/67.md
+3
-3
docs/gui/68.md
docs/gui/68.md
+3
-3
docs/gui/69.md
docs/gui/69.md
+2
-2
docs/gui/70.md
docs/gui/70.md
+1
-1
docs/gui/71.md
docs/gui/71.md
+1
-1
docs/gui/72.md
docs/gui/72.md
+1
-1
docs/gui/75.md
docs/gui/75.md
+2
-2
docs/gui/76.md
docs/gui/76.md
+1
-1
docs/gui/77.md
docs/gui/77.md
+5
-5
docs/gui/78.md
docs/gui/78.md
+4
-4
docs/gui/80.md
docs/gui/80.md
+3
-3
docs/gui/81.md
docs/gui/81.md
+5
-5
docs/gui/82.md
docs/gui/82.md
+1
-1
docs/gui/83.md
docs/gui/83.md
+3
-3
docs/gui/84.md
docs/gui/84.md
+5
-5
docs/gui/88.md
docs/gui/88.md
+2
-2
docs/gui/93.md
docs/gui/93.md
+6
-6
docs/gui/94.md
docs/gui/94.md
+1
-1
未找到文件。
docs/gui/63.md
浏览文件 @
bcb9869a
...
...
@@ -111,7 +111,7 @@ GroupLayout.ParallelGroup pg = gl.createParallelGroup(
![
GroupLayout simple example
](
img/f7dc1ec5550d5017c6b4f34aebf69dde.jpg
)
Figure: GroupLayout simple example
图:
`GroupLayout`
简单示例
## `GroupLayout`基线对齐
...
...
@@ -204,7 +204,7 @@ gl.setHorizontalGroup(gl.createSequentialGroup()
![
GroupLayout baseline alignment
](
img/fd2a88df55116f0163acd0bb92901fce.jpg
)
Figure: GroupLayout baseline alignment
图:
`GroupLayout`
基线对齐
## `GroupLayout`角按钮示例
...
...
@@ -317,7 +317,7 @@ gl.linkSize(SwingConstants.HORIZONTAL, okButton, closeButton);
![
GroupLayout corner buttons
](
img/6087cff5283f53ca902c297002ceee7a.jpg
)
Figure: GroupLayout corner buttons
图:
`GroupLayout`
角按钮
## `GroupLayout` 密码示例
...
...
@@ -440,6 +440,6 @@ gl.setVerticalGroup(gl.createSequentialGroup()
![
GroupLayout password example
](
img/6310358173dd17b6004d188b7a703395.jpg
)
Figure: GroupLayout password example
图:
`GroupLayout`
密码示例
在本章中,我们使用内置的
`GroupLayout`
管理器来创建布局。
\ No newline at end of file
docs/gui/64.md
浏览文件 @
bcb9869a
...
...
@@ -190,7 +190,7 @@ if ((mod & ActionEvent.SHIFT_MASK) > 0)
![
Event Object
](
img/d101c39bc40126cb9c7e70d442f4e373.jpg
)
Figure: Event Object
图:事件对象
## 事件处理的实现
...
...
@@ -668,7 +668,7 @@ private class ButtonListener implements ActionListener {
![
Multiple sources
](
img/63d722ed0d88c0debaaf40984ddd5e0b.jpg
)
Figure: Multiple sources
图:多个来源
## 多监听器
...
...
@@ -856,7 +856,7 @@ private class ButtonListener2 implements ActionListener {
![
Multiple Listeners
](
img/2da93dbbf34f746c3467948cd015b0bf.jpg
)
Figure: Multiple listeners
图:多个监听器
## 删除监听器
...
...
@@ -986,7 +986,7 @@ activeBox.addItemListener((ItemEvent event) -> {
![
Remove listener
](
img/f3051acacdcb318f0d9c9f03ad13d4e9.jpg
)
Figure: Remove listener
图:删除监听器
## 移动窗口
...
...
@@ -1146,7 +1146,7 @@ labely.setText("y: " + y);
![
Moving a window
](
img/bb4f4f86663aadc9c11e85f4e4e911e2.jpg
)
Figure: Moving a window
图:移动窗口
## 适配器
...
...
docs/gui/65.md
浏览文件 @
bcb9869a
...
...
@@ -457,7 +457,7 @@ var lbl1 = new JLabel(new ImageIcon("src/main/resources/cpu.png"));
![
Displaying icons
](
img/0450141998e4a520f038a5662563eaee.jpg
)
Figure: Displaying icons
图:显示图标
## `JTextField`
...
...
docs/gui/66.md
浏览文件 @
bcb9869a
...
...
@@ -576,7 +576,7 @@ slider.addChangeListener((ChangeEvent event) -> {
![
JSlider as a volume control
](
img/5402327d008ed65b0cd4d3c878536f1c.jpg
)
Figure: JSlider as a volume control
图:
`JSlider`
作为音量控件
## `JComboBox`
...
...
docs/gui/67.md
浏览文件 @
bcb9869a
...
...
@@ -142,7 +142,7 @@ errBtn.addActionListener(event -> JOptionPane.showMessageDialog(pnl,
![
Question message dialog
](
img/6c266845d620ce63bd0d55ac291896ba.jpg
)
Figure: Question message dialog
图:问题消息对话框
## 自定义对话框
...
...
@@ -338,7 +338,7 @@ private void showAboutDialog() {
![
Custom dialog
](
img/551dc1892dc094c4df0e1528022e1dcb.jpg
)
Figure: Custom dialog
图:自定义对话框
## `JFileChooser`
...
...
@@ -522,7 +522,7 @@ if (ret == JFileChooser.APPROVE_OPTION) {
![
JFileChooser dialog
](
img/e9cc4ba097c87cb5bfd2594c8a07bd99.jpg
)
Figure: JFileChooser dialog
图:
`JFileChooser`
对话框
## `JColorChooser`
...
...
docs/gui/68.md
浏览文件 @
bcb9869a
...
...
@@ -244,7 +244,7 @@ public void setEnabled(boolean b) {
![
ButtonModel
](
img/93bb146a70ec14a82d913a54fa1e92d6.jpg
)
Figure: ButtonModel
图:
`ButtonModel`
## 自定义`ButtonModel`
...
...
@@ -689,7 +689,7 @@ if (index >= 0) {
![
List models
](
img/41246bb06dbff1eec464b0d2d76c8e4c.jpg
)
Figure: List models
图:列表模型
## 文件模型
...
...
@@ -840,6 +840,6 @@ doc.setCharacterAttributes(textpane.getSelectionStart(),
![
Document model
](
img/340dc9b0bb054506513ab5ced3fe07a0.jpg
)
Figure: Document model
图:文档模型
在本章中,我们提到了 Swing 模型。
\ No newline at end of file
docs/gui/69.md
浏览文件 @
bcb9869a
...
...
@@ -14,7 +14,7 @@
![
Drag and drop
](
img/fe03bbfd63e52a3bf88c46f61a18ef7a.jpg
)
Figure: Drag and drop in Swing
图:Swing 中的拖放
开始拖动操作的组件必须注册一个
`DragSource`
对象。
`DropTarget`
是负责在拖放操作中接受拖放的对象。
`Transferable`
封装正在传输的数据。 传输的数据可以是各种类型。
`DataFlavor`
对象提供有关正在传输的数据的信息。
...
...
@@ -477,7 +477,7 @@ for (String item : data) {
![
JList drop example
](
img/cf1f166ef80964469286c4d6a469341e.jpg
)
Figure: JList drop example
图:
`JList`
放置示例
前面的示例使用了具有内置拖放支持的组件。 接下来,我们将从头开始创建拖放功能。
...
...
docs/gui/70.md
浏览文件 @
bcb9869a
...
...
@@ -411,7 +411,7 @@ g2d.fillRect(10, 15, 90, 60);
![
Rectangles
](
img/307ef18d94123c4d4c0175a623ac2ba8.jpg
)
Figure: Rectangles
图:矩形
## Swing 使用纹理
...
...
docs/gui/71.md
浏览文件 @
bcb9869a
...
...
@@ -544,6 +544,6 @@ case Cursor.N_RESIZE_CURSOR:
![
Resizable component
](
img/a99d62c6e29cd6cd196145bb95948798.jpg
)
Figure: Resizable component
图:可调整大小的组件
在 Java Swing 教程的这一部分中,我们创建了一个可调整大小的组件。
\ No newline at end of file
docs/gui/72.md
浏览文件 @
bcb9869a
...
...
@@ -504,6 +504,6 @@ private void checkSolution() {
![
Puzzle
](
img/347d0d92082678d284b30b77ff44bac7.jpg
)
Figure: Puzzle
图:益智游戏
这是益智游戏。
\ No newline at end of file
docs/gui/75.md
浏览文件 @
bcb9869a
...
...
@@ -35,7 +35,7 @@ NetBeans IDE 具有 JavaFX 项目类别。 可通过菜单栏中的文件,新
![
JavaFX project category in NetBeans
](
img/d0850a6644d71891f31a0f01a4cc5a58.jpg
)
Figure: JavaFX project category in NetBeans
图:NetBeans 中的 JavaFX 项目类别
## 首次申请
...
...
@@ -189,7 +189,7 @@ public static void main(String[] args) {
![
First JavaFX application
](
img/332832ac21fd3e3a78b95422d6e52baf.jpg
)
Figure: First JavaFX application
图:第一个 JavaFX 应用程序
## Swing 和 SWT
...
...
docs/gui/76.md
浏览文件 @
bcb9869a
...
...
@@ -374,6 +374,6 @@ scene.getStylesheets().add(this.getClass().getResource("text.css")
![
Styled Text control
](
img/db572a0ae13e35d1088e1286367f7004.jpg
)
Figure: Styled Text control
图:样式文本控件
在本章中,我们创建了一些简单的 JavaFX 程序。
\ No newline at end of file
docs/gui/77.md
浏览文件 @
bcb9869a
...
...
@@ -209,7 +209,7 @@ for (int i=1; i<=20; i++) {
![
FlowPane
](
img/cdad5e249a597e10012a77a92bcb196e.jpg
)
Figure: FlowPane
图:
`FlowPane`
## `HBox`
...
...
@@ -305,7 +305,7 @@ root.getChildren().addAll(prevBtn, nextBtn, cancBtn, helpBtn);
![
A row of buttons created with a HBox
](
img/f74a709b2de15156b47980a69d4e3af5.jpg
)
Figure: A row of buttons created with a HBox
图:使用
`HBox`
创建的一排按钮
## `BorderPane`
...
...
@@ -470,7 +470,7 @@ lbl.setStyle("-fx-border-style: dotted; -fx-border-width: 0 0 1 0;"
![
BorderPane
](
img/38c1c356de5fc1032ed9edd0ea335e27.jpg
)
Figure: BorderPane
图:
`BorderPane`
## `AnchorPane`
...
...
@@ -576,7 +576,7 @@ AnchorPane.setBottomAnchor(hbox, 10d);
![
Corner buttons
](
img/20c0b9510497535d2ce72f438ac54be1.jpg
)
Figure: Corner buttons
图:角按钮
## `GridPane`
...
...
@@ -760,7 +760,7 @@ root.add(field, 1, 0, 3, 1);
![
MigPane JARs
](
img/a60c0cf259e04720a73b1f82578ec043.jpg
)
Figure: MigPane JARs
图:
`MigPane`
JAR
要使用
`MigPane`
,必须将 JAR 包含到项目库中。 用于源代码和 javadoc 的 JAR 是可选的。
...
...
docs/gui/78.md
浏览文件 @
bcb9869a
...
...
@@ -258,7 +258,7 @@ lbl1.setMnemonicParsing(true);
![
The labelFor property
](
img/c32b295e94665e274003f2ebe9b1bfaf.jpg
)
Figure: The labelFor property
图:
`labelFor`
属性
在某些平台上,必须按无鼠标修饰符(通常为
`Alt`
)以显示下划线。 在图中,通过按
`Alt + A`
将焦点转移到中间文本字段。
...
...
@@ -530,7 +530,7 @@ private void loadImages() {
![
Slider
](
img/d975a62e2ef67a3b0deb48320a719a89.jpg
)
Figure: Slider
图:
`Slider`
## 选择框
...
...
@@ -637,7 +637,7 @@ model.selectedItemProperty().addListener((ObservableValue observable,
![
ChoiceBox
](
img/215f91ae0a644a02e4f4a646b48cf4c5.jpg
)
Figure: ChoiceBox
图:
`ChoiceBox`
## 进度条
...
...
@@ -752,6 +752,6 @@ btn.setOnAction((ActionEvent actionEvent) -> {
![
ProgressBar
](
img/f0e667bd9117d2953c216652af85f8db.jpg
)
Figure: ProgressBar
图:
`ProgressBar`
在 JavaFX 教程的这一部分中,我们介绍了基本的 JavaFX 控件。
\ No newline at end of file
docs/gui/80.md
浏览文件 @
bcb9869a
...
...
@@ -491,7 +491,7 @@ private class MyButtonHandler implements EventHandler<ActionEvent> {
![
Multiple sources
](
img/67fb0cc0d970c1bb94aad83b50ff7f5a.jpg
)
Figure: Multiple sources
图:多个来源
## `java.util.Timer`
...
...
@@ -665,7 +665,7 @@ private class MyTimerTask extends TimerTask {
![
Time elapsed
](
img/0f5b96fe0a2c6db056168c7f1d69d5fa.jpg
)
Figure: Time elapsed
图:经过的时间
## 移动窗口
...
...
@@ -819,6 +819,6 @@ stage.xProperty().addListener(new ChangeListener<Number>() {
![
Moving a window
](
img/b14033d5b566a3f8ab11d6a971a2026b.jpg
)
Figure: Moving a window
图:移动窗口
JavaFX 教程的这一部分专门讨论 JavaFX 事件。
\ No newline at end of file
docs/gui/81.md
浏览文件 @
bcb9869a
...
...
@@ -95,7 +95,7 @@ rect.setEffect(ds);
![
DropShadow
](
img/1c7c6f354beb5dfee2d43f55fb7dbb8f.jpg
)
Figure: DropShadow
图:
`DropShadow`
## 反射
...
...
@@ -319,7 +319,7 @@ slider.valueProperty().addListener(event -> {
![
Lighting
](
img/bd1fbb80b7fd8d89bee75201a39741e7.jpg
)
Figure: Lighting
图:
`Lighting`
## 高斯模糊
...
...
@@ -421,7 +421,7 @@ slider.valueProperty().addListener(event -> {
![
GaussianBlur
](
img/abea6db020aeac86024b282785082edc.jpg
)
Figure: GaussianBlur
图:
`GaussianBlur`
## 棕褐色调
...
...
@@ -661,7 +661,7 @@ board.setEffect(e);
![
Chessboard
](
img/d87b964ee9843af1a6073d56a6711215.jpg
)
Figure: Chessboard
图:
`Chessboard`
## 组合效果
...
...
@@ -780,6 +780,6 @@ text.setEffect(ref);
![
Combining effects
](
img/dc2f04ceea31eb11c51fa88a16b1b0d0.jpg
)
Figure: Combining effects
图:组合效果
在本章中,我们创建了几种视觉效果。
\ No newline at end of file
docs/gui/82.md
浏览文件 @
bcb9869a
...
...
@@ -463,7 +463,7 @@ ptr.play();
![
PathTransition
](
img/44fc19f4ea7c2e24dcfded41c0665936.jpg
)
Figure: PathTransition
图:
`PathTransition`
## 并行转换
...
...
docs/gui/83.md
浏览文件 @
bcb9869a
...
...
@@ -240,7 +240,7 @@ gc.fillOval(30, 30, 80, 80);
![
Stroke and fill
](
img/88bdbf69cc4fa7a5b41c9bced1150e18.jpg
)
Figure: Stroke and fill
图:描边和填充
## 颜色
...
...
@@ -438,7 +438,7 @@ LinearGradient lg1 = new LinearGradient(0, 0, 1, 0, true,
![
LinearGradient
](
img/978054180e3e8f16f3fb1e143ea37859.jpg
)
Figure: LinearGradient
图:
`LinearGradient`
### 径向渐变
...
...
@@ -531,7 +531,7 @@ RadialGradient lg1 = new RadialGradient(0, 0, 0.5, 0.5, 0.8, true,
![
RadialGradient
](
img/974754240fecad97506af822e104d97f.jpg
)
Figure: RadialGradient
图:
`RadialGradient`
## 形状
...
...
docs/gui/84.md
浏览文件 @
bcb9869a
...
...
@@ -132,7 +132,7 @@ lineChart.getData().add(data);
![
LineChart
](
img/bc6c45d6dc988f8e2e82d7fcb61b7029.jpg
)
Figure: LineChart
图:
`LineChart`
## 区域图
...
...
@@ -234,7 +234,7 @@ xAxis.setLabel("Time");
![
AreaChart
](
img/4a91fbbbec6c9f472973501e60569af8.jpg
)
Figure: AreaChart
图:
`AreaChart`
## 散点图
...
...
@@ -337,7 +337,7 @@ data.getData().add(new XYChart.Data("Mar 14", 43));
![
ScatterChart
](
img/2fd94b46b7fe55698b80c13e99ad0e34.jpg
)
Figure: ScatterChart
图:
`ScatterChart`
## 条形图
...
...
@@ -425,7 +425,7 @@ BarChart barChart = new BarChart(xAxis, yAxis);
![
AreaChart
](
img/a0d66926dbe5e7a46487002a496083e8.jpg
)
Figure: AreaChart
图:
`AreaChart`
## 饼形图
...
...
@@ -518,6 +518,6 @@ PieChart pieChart = new PieChart(pieChartData);
![
PieChart
](
img/8a76797799de4938bfa2077679912a8a.jpg
)
Figure: PieChart
图:
`PieChart`
在本章中,我们在 JavaFX 中创建了
`LineChart`
,
`AreaChart`
,
`ScatterChart`
,
`BarChart`
和
`PieChart`
。
[
JFreechart 教程
](
/java/jfreechart
)
显示了如何在流行的 JFreechart 库中创建图表。
\ No newline at end of file
docs/gui/88.md
浏览文件 @
bcb9869a
...
...
@@ -283,7 +283,7 @@ Close(true);
![
Button
](
img/afa95aa0d27126987b28cb6929a03ba5.jpg
)
Figure: Button
图:按钮
## 小部件通信
...
...
@@ -467,6 +467,6 @@ comm->m_rp->m_text->SetLabel(wxString::Format(wxT("%d"), count));
![
Widgets communicate
](
img/8c8dcc641656f166353a1eba2418d7ca.jpg
)
Figure: Widgets communicate
图:小部件通信
在 wxWidgets 教程的这一部分中,我们创建了一些简单的程序。
\ No newline at end of file
docs/gui/93.md
浏览文件 @
bcb9869a
...
...
@@ -122,7 +122,7 @@ if (m_cb->GetValue()) {
![
wxCheckBox
](
img/252ee36c10cb57cef6f46afbcfa3ee62.jpg
)
Figure: wxCheckBox
图:
`wxCheckBox`
## `wxBitmapButton`
...
...
@@ -247,7 +247,7 @@ pos = slider->GetValue();
![
wxBitmapButton
](
img/6773ecac71ccba9d2292c8ea5f253520.jpg
)
Figure: wxBitmapButton
图:
`wxBitmapButton`
## `wxToggleButton`
...
...
@@ -445,7 +445,7 @@ m_panel->SetBackgroundColour(colour->GetAsString());
![
wxToggleButton
](
img/074b52a6ff497677f69a0cc2f7945064.jpg
)
Figure: wxToggleButton
图:
`wxToggleButton`
## `wxStaticLine`
...
...
@@ -576,7 +576,7 @@ wxStaticLine *sl1 = new wxStaticLine(this, wxID_ANY, wxPoint(25, 50),
![
wxStaticLine
](
img/abcbd22bfd5119e5e162aec34645fda4.jpg
)
Figure: wxStaticLine
图:
`wxStaticLine`
## `wxStaticText`
...
...
@@ -669,7 +669,7 @@ wxStaticText *st = new wxStaticText(panel, wxID_ANY, text,
![
wxStaticText
](
img/36434b64e7918e41aa8fb80eb1a3fc5a.jpg
)
Figure:
`wxStaticText`
图:
`wxStaticText`
## wxSlider
...
...
@@ -832,6 +832,6 @@ dc.DrawRectangle(wxRect(140, 30, 80, fill));
![
wxSlider
](
img/43e2a9c9a8122d76c6af53a4c85c27d9.jpg
)
Figure: wxSlider
图:
`wxSlider`
在 wxWidgets 教程的这一部分中,我们介绍了各种小部件。
\ No newline at end of file
docs/gui/94.md
浏览文件 @
bcb9869a
...
...
@@ -270,7 +270,7 @@ if (!renamed.IsEmpty()) {
![
Listbox
](
img/51cfc206cb1b13626a2a15a0aba17c93.jpg
)
Figure: Listbox
图:列表框
## `wxNotebook`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录