learning java AWT Dialog
import java.awt.*;
public class DialogTest {
Frame f = new Frame("test");
Dialog d1 = new Dialog(f, "model dialog", true);
Dialog d2 = new Dialog(f, "non-model dialog", false);
Button b1 = new Button("open model dialog");
Button b2 = new Button("open non-model dialog");
public void init(){
d1.setBounds(,,,);
d2.setBounds(,,,);
b1.addActionListener(e -> d1.setVisible(true));
b2.addActionListener(e -> d2.setVisible(true));
f.add(b1);
f.add(b2,BorderLayout.SOUTH);
f.pack();
f.setVisible(true);
}
public static void main(String[] args) {
new DialogTest().init();
}
}
output:

learning java AWT Dialog的更多相关文章
- learning java AWT 剪贴板 传递文本
import javax.swing.*; import java.awt.*; import java.awt.datatransfer.Clipboard; import java.awt.dat ...
- learning java AWT 手绘窗口
import java.awt.*;port java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import jav ...
- learning java AWT 画图
import javax.swing.*; import java.awt.*; import java.util.Random; public class SimpleDraw { private ...
- learning java AWT 右键菜单
import java.awt.*; import java.awt.event.*; public class SimpleMenu { private Frame f = new Frame(&q ...
- learning java AWT MenuBar Menu MenuItem菜单
import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java ...
- learning java AWT widowEvent and MouseEvent
import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import jav ...
- learning java AWT EventQs
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.Ac ...
- learning java AWT 常见组件
import javax.swing.*; import java.awt.*; public class CommonComponent { Frame f = new Frame("te ...
- learning java AWT BoxLayout布局管理器
import javax.swing.*; import java.awt.*; public class BoxSpaceTest { private Frame f = new Frame(&qu ...
随机推荐
- THUSC2019:Illusory World
拿了1=就来更 Update:没约咕了
- Linux 系统中如何进入退出 vim 编辑器
在 Linux 中,vim 编辑器是系统自带的文本编辑器,但要修改某个文本文件,可不是像 Windows 那样操作,更有新手,进入 vi 编辑器后,无法退出以致于强制关机,其实,这个vim(vi)也是 ...
- asp.net core EF code first
以连接mysql数据库为例 一 安装组件 Microsoft.EntityFrameworkCore Microsoft.EntityFrameworkCore.Relational Microsof ...
- 规格化设计——OO第三单元总结
规格化设计--OO第三单元总结 一.JML语言理论基础.应用工具链 1.1 JML语言 JML(java modeling language)是一种描述代码行为的语言,包括前置条件.副作用等等.J ...
- 深入理解TCP三握四挥
面试中被问到不少次TCP的三握四挥,今天特意来做一个总结(一些资料是很久前找的,忘了参考的链接了) 一.三次握手 首先来看一张图 最初,客户机A与服务器B的TCP进程都处于 CLOSED 状态. 然后 ...
- uavcan扩展帧格式 zubax
zubax_gnss_1.0和zubax_gnss_2.0中使用的uavcan的两种不同封装方式.都是采用扩展帧29b帧类型 zubax_gnss_1.0 我的代码:https://github.co ...
- springBoot集成Redis,RedisTmple操作redis和注解实现添加和清空缓存功能
配置 maven项目进入相关配置 <dependency> <groupId>org.springframework.boot</groupId> &l ...
- 根据值获取枚举类对象工具类EnumUtils
枚举类 public enum Sex { man("M","男"),woman("W","女"); private S ...
- EasyUI DataGrid 根据ID选中行(转载)
转载来源: https://blog.csdn.net/chq00788/article/details/51505519 function selectRows(){ //获取需要选中的记录ID ...
- ViewBag---MVC3中 ViewBag、ViewData和TempData的使用和差别-------与ViewBag+Hashtable应用例子
ViewBag 在MVC3開始.视图数据能够通过ViewBag属性訪问.在MVC2中则是使用ViewData.MVC3中保留了ViewData的使用.ViewBag 是动态类型(dynamic),Vi ...