当前位置: 首页 > 编程日记 > 正文

[JAVA] java仿windows 字体设置选项卡


想用java做一个像windows里一样的txt编辑软件,涉及到字体设置选项卡,在网上找了很久都没找到,就生气啦自己写一个,现在贴这里分享一下,下次再遇到这样的问题就不用自己亲自打代码啦!

复制代码
  1 package 实验;
  2 
  3 import java.awt.*;
  4 import java.awt.event.ActionEvent;
  5 import java.awt.event.ActionListener;
  6 import java.awt.event.MouseAdapter;
  7 import java.awt.event.MouseEvent;
  8 
  9 import javax.swing.*;
 10 import javax.swing.border.BevelBorder;
 11 
 12 /**
 13  * 字体格式设置对话框
 14  */
 15 
 16 public class FontFormat extends JDialog {
 17 
 18     private JLabel nameLb;
 19     private JLabel styleLb;
 20     private JLabel sizeLb;
 21     private JLabel presLb;
 22     private JTextField nameTx;
 23     private JTextField styleTx;
 24     private JTextField sizeTx;
 25     private JTextField presTx;
 26     private JList nameLt;
 27     private JList styleLt;
 28     private JList sizeLt;
 29     private JScrollPane jScrollPane1;
 30     private JScrollPane jScrollPane2;
 31     private JScrollPane jScrollPane3;
 32     private JButton approve;
 33     private JButton cancel;
 34     private JButton chose;
 35     private JRadioButton[] language = new JRadioButton[2];
 36     private ButtonGroup languageg;
 37     private String Slanguage[] = { new String("李涛"), new String("ABC") };
 38 
 39     private static JFrame frame;
 40     public Font font, newFont;// 字体类
 41     private Color color;// 颜色类
 42     Color newColor;
 43 
 44     private JFileChooser fileChoose = new JFileChooser();// 文件选择类实例
 45     private JDialog colorDlg;// 颜色对话框
 46     private JColorChooser colorChoose = new JColorChooser();// 颜色选择类实例
 47 
 48     private GraphicsEnvironment environment; // 该类中又获取系统字体的方法;
 49     private String[] fontNameSet;// 字体‘逻辑名’集
 50     // 字体‘样式’集的字符串数组
 51     private String[] fontStyleSet = { "常规", "倾斜", "加粗", "倾斜 加粗" };
 52     // 字体‘样式’集的常量数组
 53     private Integer[] fontCon = { Font.PLAIN, Font.ITALIC, Font.BOLD,
 54             Font.BOLD | Font.ITALIC };
 55     // 字体‘大小’集
 56     private String[] fontSizeSet = { "6", "7", "8", "9", "10", "11", "12",
 57             "14", "16", "18", "20", "22", "24", "26", "28", "36", "48", "72" };
 58 
 59     public static void main(String args[]) {// 主函数
 60         FontFormat a = new FontFormat();
 61         a.setVisible(true);
 62     }
 63 
 64     public FontFormat() {// 无参构造函数
 65         super(frame, "李涛—字体设置窗口", true);
 66         frame = new JFrame();
 67         initGUI();
 68     }
 69 
 70     public FontFormat(JFrame frame) {// 含参构造函数
 71         super(frame, "李涛—字体设置窗口", true);
 72         this.frame = frame;// 父窗口中必须有一个public的Font对象
 73         // setAlwaysOnTop(true);
 74         initGUI();
 75     }
 76 
 77     private void initGUI() {// 字体格式选择器的界面初始化
 78         try {
 79             getContentPane().setLayout(null);
 80             environment = GraphicsEnvironment.getLocalGraphicsEnvironment();// GraphicsEnvironment是一个抽象类,不能实例化,只能用其中的静态方法获取一个实例
 81             fontNameSet = environment.getAvailableFontFamilyNames();// 获取系统字体
 82             addMenu();// 加入菜单
 83             initFont();// 初始化字体
 84             // pack();
 85             setSize(380, 337);
 86             setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 87             setWindowPos();// 使窗口屏幕居中
 88             setResizable(false);// 大小不可变
 89         } catch (Exception e) {
 90             e.printStackTrace();
 91         }
 92     }
 93 
 94     private void initFont() {// 初始化字体
 95         // 设置默认字体格式为父窗口font对向的字体格式
 96         if (frame.getFont() == null) {
 97             nameTx.setText(fontNameSet[0]);
 98             styleTx.setText(fontStyleSet[0]);
 99             sizeTx.setText("12");
100             nameLt.setSelectedValue(fontNameSet[0], true);
101             styleLt.setSelectedIndex(0);
102             sizeLt.setSelectedValue("12", true);
103             font = new Font(fontNameSet[0], fontCon[0], 12);
104             newFont = font;// 保存原来的字体格式
105             presTx.setFont(font);
106             // JOptionPane.showMessageDialog(null, "ccac");
107         } else {
108             int idxStyle = 0;
109             for (int i = 0; i < fontCon.length; i++) {
110                 if (fontCon[i] == frame.getFont().getStyle())
111                     idxStyle = i;
112             }
113             nameTx.setText(frame.getFont().getName());// 改text
114             styleTx.setText(fontStyleSet[idxStyle]);
115             sizeTx.setText("" + frame.getFont().getSize());
116             nameLt.setSelectedValue(frame.getFont().getName(), true);// 改list显示
117             styleLt.setSelectedIndex(idxStyle);
118             sizeLt.setSelectedValue("" + frame.getFont().getSize(), true);
119             font = new Font(fontNameSet[0], fontCon[0], 12);// 保存当前格式
120             newFont = font;// 保存原来的字体格式
121             presTx.setFont(font);// 预览中设为当前模式
122         }
123     }
124 
125     private void addMenu() {// 加入菜单
126         // 4个lable---------------------------------------------------------------------------------
127         nameLb = new JLabel();
128         getContentPane().add(nameLb);
129         nameLb.setText("字体:");
130         nameLb.setBounds(10, 14, 120, 26);
131         nameLb.setFont(new java.awt.Font("SimSun", 1, 14));
132 
133         styleLb = new JLabel();
134         getContentPane().add(styleLb);
135         styleLb.setText("字型:");
136         styleLb.setBounds(151, 14, 120, 23);
137         styleLb.setFont(new java.awt.Font("SimSun", 1, 14));
138 
139         sizeLb = new JLabel();
140         getContentPane().add(sizeLb);
141         sizeLb.setText("大小:");
142         sizeLb.setBounds(275, 14, 79, 24);
143         sizeLb.setFont(new java.awt.Font("SimSun", 1, 14));
144 
145         presLb = new JLabel();
146         getContentPane().add(presLb);
147         presLb.setText("预览:");
148         presLb.setBounds(151, 150, 120, 80);
149         presLb.setFont(new java.awt.Font("SimSun", 1, 14));
150 
151         // 4个textfield---------------------------------------------------------------------------------
152         nameTx = new JTextField();
153         nameTx.setEditable(false);
154         getContentPane().add(nameTx);
155         nameTx.setBounds(10, 42, 120, 22);
156 
157         styleTx = new JTextField();
158         styleTx.setEditable(false);
159         getContentPane().add(styleTx);
160         styleTx.setBounds(151, 42, 100, 21);
161 
162         sizeTx = new JTextField();
163         sizeTx.setEditable(false);
164         getContentPane().add(sizeTx);
165         sizeTx.setBounds(275, 42, 79, 22);
166 
167         presTx = new JTextField();
168         presTx.setEditable(false);
169         getContentPane().add(presTx);
170         presTx.setBounds(151, 200, 203, 61);
171         presTx.setText(Slanguage[1]);
172 
173         // 3个下拉条--+监听-----------------------------------------------------------------------------
174         jScrollPane1 = new JScrollPane();
175         getContentPane().add(jScrollPane1);
176         jScrollPane1.setBounds(10, 74, 120, 210);
177         {
178             ListModel fontNameModel = new DefaultComboBoxModel(fontNameSet);
179             nameLt = new JList();
180             jScrollPane1.setViewportView(nameLt);
181             nameLt.setModel(fontNameModel);
182             nameLt.setBounds(274, 193, 90, 86);
183             nameLt.setBorder(BorderFactory
184                     .createEtchedBorder(BevelBorder.LOWERED));
185             nameLt.addMouseListener(new MouseAdapter() {
186                 public void mouseClicked(MouseEvent evt) {
187                     nameLtMouseClicked(evt);
188                 }
189             });
190         }
191 
192         jScrollPane2 = new JScrollPane();
193         getContentPane().add(jScrollPane2);
194         jScrollPane2.setBounds(151, 74, 100, 103);
195         {
196             ListModel fontStyleModel = new DefaultComboBoxModel(fontStyleSet);
197             styleLt = new JList();
198             jScrollPane2.setViewportView(styleLt);
199             styleLt.setModel(fontStyleModel);
200             styleLt.setBounds(310, 215, 70, 102);
201             styleLt.setBorder(BorderFactory
202                     .createEtchedBorder(BevelBorder.LOWERED));
203             styleLt.addMouseListener(new MouseAdapter() {
204                 public void mouseClicked(MouseEvent evt) {
205                     styleLtMouseClicked(evt);
206                 }
207             });
208         }
209 
210         jScrollPane3 = new JScrollPane();
211         getContentPane().add(jScrollPane3);
212         jScrollPane3.setBounds(275, 75, 79, 100);
213         {
214             ListModel fontSizeModel = new DefaultComboBoxModel(fontSizeSet);
215             sizeLt = new JList();
216             jScrollPane3.setViewportView(sizeLt);
217             sizeLt.setModel(fontSizeModel);
218             sizeLt.setBounds(300, 218, 54, 102);
219             sizeLt.setBorder(BorderFactory
220                     .createEtchedBorder(BevelBorder.LOWERED));
221             sizeLt.addMouseListener(new MouseAdapter() {
222                 public void mouseClicked(MouseEvent evt) {
223                     sizeLtMouseClicked(evt);
224                 }
225             });
226         }// -------------------------------------------------------------------------------------
227 
228         // 中英选项(---------------------------------------------------------------------------------
229         languageg = new ButtonGroup();
230         language[0] = new JRadioButton("中");
231         getContentPane().add(language[0]);
232         language[0].setSelected(false);// 初始化显示
233         language[0].setBounds(271, 179, 40, 20);
234         language[0].setFont(new java.awt.Font("SimSun", 1, 12));
235         languageg.add(language[0]);
236         language[0].addActionListener(new ActionListener() {
237             public void actionPerformed(ActionEvent evt) {
238                 presTx.setText(Slanguage[0]);
239             }
240         });
241 
242         language[1] = new JRadioButton("英");
243         getContentPane().add(language[1]);
244         language[1].setSelected(true);
245         language[1].setBounds(321, 179, 40, 20);
246         language[1].setFont(new java.awt.Font("SimSun", 1, 12));
247         languageg.add(language[1]);
248         language[1].addActionListener(new ActionListener() {
249             public void actionPerformed(ActionEvent evt) {
250                 presTx.setText(Slanguage[1]);
251             }
252         });
253 
254         // 3个按钮+监听---------------------------------------------------------------------------------
255         // 确定按钮
256         approve = new JButton();
257         getContentPane().add(approve);
258         approve.setText("确定");
259         approve.setBounds(151, 265, 67, 20);
260         approve.setFont(new java.awt.Font("KaiTi_GB2312", 1, 12));
261         approve.addActionListener(new ActionListener() {
262             public void actionPerformed(ActionEvent evt) {
263                 approveActionPerformed(evt);
264             }
265         });
266 
267         // 取消按钮
268         cancel = new JButton();
269         getContentPane().add(cancel);
270         cancel.setText("取消");
271         cancel.setBounds(219, 265, 67, 20);
272         cancel.setFont(new java.awt.Font("KaiTi_GB2312", 1, 12));
273         cancel.addActionListener(new ActionListener() {
274             public void actionPerformed(ActionEvent evt) {
275                 cancelActionPerformed(evt);
276             }
277         });
278 
279         // 颜色选择按钮
280         chose = new JButton();
281         getContentPane().add(chose);
282         chose.setText("颜色");
283         chose.setBounds(287, 265, 67, 20);
284         chose.setFont(new java.awt.Font("KaiTi_GB2312", 1, 12));
285         chose.addActionListener(new ActionListener() {
286             public void actionPerformed(ActionEvent evt) {
287                 choseActionPerformed(evt);
288             }
289         });// -------------------------------------------------------------------------
290     }
291 
292     private void setWindowPos() {// 窗口居中
293         Toolkit kit = Toolkit.getDefaultToolkit();// 抽象类,通过静态方法获取实例
294         Dimension frameSize = new Dimension(), screenSize = kit.getScreenSize(); // 获取屏幕的大小
295         getSize(frameSize); // 获取窗口大小
296         setLocation((screenSize.width - frameSize.width) / 2,
297                 (screenSize.height - frameSize.height) / 2);
298     }
299 
300     private void nameLtMouseClicked(MouseEvent evt) {// 字体逻辑名列表的鼠标单击事件
301         nameTx.setText(nameLt.getSelectedValue().toString());
302         font = new Font(nameTx.getText(), font.getStyle(), font.getSize());
303         presTx.setFont(font);
304     }
305 
306     private void styleLtMouseClicked(MouseEvent evt) {// 字体样式列表的鼠标单击事件
307         String temp = styleLt.getSelectedValue().toString();
308         styleTx.setText(temp);
309         int index = 0;
310         while (index < 4 && !fontStyleSet[index].equals(temp)) {
311             index++;
312         }
313         font = new Font(font.getName(), fontCon[index], font.getSize());
314         presTx.setFont(font);
315     }
316 
317     private void sizeLtMouseClicked(MouseEvent evt) {// 字体大小列表的鼠标点击事件
318         sizeTx.setText(sizeLt.getSelectedValue().toString());
319         font = new Font(font.getName(), font.getStyle(),
320                 Integer.parseInt(sizeTx.getText()));
321         presTx.setFont(font);
322     }
323 
324     private void approveActionPerformed(ActionEvent evt) {// 确定按钮的触发事件
325         String name = nameTx.getText();
326         int style = fontCon[styleLt.getSelectedIndex()];
327         int size = Integer.parseInt(sizeTx.getText());
328         font = new Font(name, style, size);
329         frame.setFont(font); // 父窗口的Font对象
330         newFont = font;// 更新原来保存格式
331         newColor = color;// 更新颜色
332         this.dispose();
333     }
334 
335     private void cancelActionPerformed(ActionEvent evt) {// 取消按钮的触发事件
336         this.dispose();
337     }
338 
339     private void choseActionPerformed(ActionEvent evt) {// 颜色选择触发事件
340         if (colorDlg == null) {
341             colorDlg = JColorChooser.createDialog(FontFormat.this,
342                     "Select Text Color", true, colorChoose,
343                     new ColorOKListener(), null);
344         }
345         colorChoose.setColor(color = presTx.getForeground());
346         colorDlg.setVisible(true);
347     }
348 
349     class ColorOKListener implements ActionListener {// 重写颜色按钮点击监听类覆盖接口ActionListener
350         public void actionPerformed(ActionEvent e) {
351             Color c = colorChoose.getColor();
352             color = c;
353             presTx.setForeground(c);
354             presTx.repaint();
355         }
356     }
357 }
复制代码


本文转自beautifulzzzz博客园博客,原文链接:http://www.cnblogs.com/zjutlitao/p/3554815.html,如需转载请自行联系原作者

相关文章:

android小球移动代码,Android自定义圆形View实现小球跟随手指移动效果

本文实例为大家分享了Android实现小球跟随手指移动效果的具体代码&#xff0c;供大家参考&#xff0c;具体内容如下一. 需求功能手指在屏幕上滑动&#xff0c;红色的小球始终跟随手指移动。实现的思路&#xff1a;1)自定义View&#xff0c;在onDraw中画圆作为小球&#xff1b;2…

从试用到使用:计算机视觉产业新一轮发展的起步年

参加 2018 AI开发者大会&#xff0c;请点击官网报名 CSDN 出品的《2018-2019 中国人工智能产业路线图》V2.0 版即将重磅面世&#xff01; V1.0 版发布以来&#xff0c;我们有幸得到了诸多读者朋友及行业专家的鼎力支持&#xff0c;在此表示由衷感谢。此次 V2.0 版路线图将进行新…

被人恨,但感觉不错!

做销售四年多了&#xff0c;从来没有碰到目前遇到的情况&#xff0c;心中的郁闷&#xff0c;真的没办法排除&#xff0c;干脆写到BLOG上&#xff0c;也算发泄&#xff0c;也算记录&#xff01;早两三年&#xff0c;一直在软件和IT服务行业打混&#xff0c;接触的多是企业老总&a…

android联动动画,利用 CollapsingToolbarLayout 完成联动的动画效果

最近项目中需要实现个动画效果,研究了下这里做下简单的分享.效果图如下:示例.gif最初的想法是自己去利用 Android 的嵌套滚动机制,去实现上面的嵌套滚动效果.但最后为了开发效率直接利用了 CollapsingToolbarLayout 和 CoordinatorLayout 的效果.实现效果的原理十分简单,监听 C…

波士顿动力机器人逆天,人类已无法阻挡它的三级跳!

一直刷新大众认知的波士顿动力又秀出了新花样。 如今&#xff0c;波士顿动力的 Atlas 人形机器人可以玩跑酷了&#xff01;在该公司发布的一段最新视频中&#xff0c;Atlas 展示了它可以单脚越过障碍物、跳到交错的箱子上&#xff0c;毫不费力&#xff01; 该公司表示&#xff…

自制程序清除系统垃圾文件

电脑用久了&#xff0c;系统分区内肯定会有很多垃圾文件&#xff0c;占据着大量空间&#xff0c;严重影响系统运行速度&#xff0c;这个程序能自动清理电脑里的垃圾而不会破坏系统。1. 在桌面上点鼠标右键&#xff0c;新建一个文本文件&#xff0c;把下面的字复制进去&#xff…

pylons中常用的paster命令

paster create -t pylons helloworld 创建一个以pylons为模板的项目&#xff0c;项目名字是helloworldpaster create --list-templates 显示当前的pylons中有多少可以使用的模板 paster serve --reaload development.ini 最常用的命令了&#xff0c;启动调式程序的时候都…

What-If 工具:无需写代码,即可测试机器学习模型

文 / Google AI 软件工程师 James Wexler 构建有效的机器学习 (ML) 系统需要提出许多问题。仅仅训练一个模型&#xff0c;然后放任不管&#xff0c;是远远不够的。而优秀的开发者就像侦探一样&#xff0c;总是不断探索&#xff0c;试图更好地理解自己的模型&#xff1a;数据点的…

linux如何安装neo4j,Ubuntu16.04 如何安装neo4j数据库

什么是neo4j数据库&#xff1f;neo4j数据库是图数据库的一种&#xff0c;属于nosql的一种&#xff0c;常见的nosql数据库还有redis、memcached、mongDB等&#xff0c;不同于传统的关系型数据库&#xff0c;nosql数据也有其独特之处&#xff0c;例如图数据库&#xff0c;在处理对…

MSI文件制作全过程

MSI文件制作全过程 这两天学习制作MSI文件用于组策略发布&#xff0c;试了一些做.MSI文件的软件包括Win2000Server光盘带的WinINSTALL LE&#xff0c;实际做出来的效果都不好。最后找到InstallShield AdminStudio5&#xff0c;用它做的MSI文件在组策略中成功发布。下面就以“石…

C语言 带比较器的归并排序

1 #include <stdio.h>2 #include <stdlib.h>3 4 typedef int DataType;5 6 //比较器7 int mycmp(const void * a, const void *b); 8 9 //int (*compar)(const void *, const void *) 函数指针 10 void Sort(DataType * arr, int from, int to, int (*compar)(cons…

iphone adb android,通过ADB获取Android手机信息

1、获取手机体系信息(CPU&#xff0c;厂商名称等)adbshell”cat/system/build.prop|grep”product””2、获取手机体系版别adbshellgetpropro.build.version.release3、获取手机体系api版别adbshellgetpropro.build.version.sdk4、获取手机设备类型adb-dshellgetpropro.product…

浩方平台CS流量评估

因为需要做了一次这样的简单的流量评估,就顺便拿出来给大家共享一下转载于:https://blog.51cto.com/niujh/10164

深度学习深陷可解释性泥淖,而这个研究领域正逐步焕发生机

只讲技术&#xff0c;拒绝空谈&#xff01;2018 AI开发者大会精彩议程曝光》 福利 11月2日前购票&#xff0c;立享7折优惠&#xff01;更有学生专享福利&#xff01;扫码报名↓↓↓

php redis 安装和使用

为什么80%的码农都做不了架构师&#xff1f;>>> mac安装 redis $brew update $brew install redis > Downloading https://homebrew.bintray.com/bottles/redis-4. Already downloaded: /Users/lph/Library/Caches/Homebrew/redis-4.0.2.sierra.bottle.tar.gz &…

怎样在javascript函数中将变量传递给服务端脚本程序?

怎样在javascript函数中将变量传递给服务端脚本程序?(有朋友问上述问题, 愿把结论分享给大家).摘 要: 服务器端脚本运行时, 它只会解释执行<% %>或<?php ?%> 之间的脚本语句, 它会把客户端脚本视作 普通文本. 而客户端脚本运行时, 服务器端脚本又是不可见的(客…

android studio val,Kotlin学习笔记之const val与val

const的使用const 必须修饰valconst 只允许在top-level级别和object中声明&#xff0c;使用方式如下&#xff1a;const val THOUSAND 1000object myObject {const val constNameObject: String "constNameObject"}class MyClass {companion object Factory {const …

算法开发人员的安身之本:如何将机器学习与各行各业进行深度结合

只讲技术&#xff0c;拒绝空谈&#xff01;2018 AI开发者大会精彩议程曝光》 2018 AI开发者大会 2018 AI开发者大会是一场由中美人工智能技术高手联袂打造的AI技术与产业的年度盛会&#xff01;是一场以技术落地为导向的干货会议&#xff01;大会设置了10场技术专题论坛&#x…

android intent email,Android Email Intent

问题Ive set up two buttons. One opens the compose sms intent and the other opens the compose email intent. The sms intent works fine but the email button doesnt respond. Ive created a categorychooser but that doesnt show up....UNTIL I click the sms buttonT…

C#实现的18位×××格式验证算法

18位标准在国家质量技术监督局于1999年7月1日实施的GB11643-1999《公民身份号码》中做了明确的规定。 GB11643-1999《公民身份号码》为GB11643-1989《社会保障号码》的修订版&#xff0c;其中指出将原标准名称"社会保障号码"更名为"公民身份号码"&#xff…

大家都收藏了的最新开源项目Top12!CV、NLP、机器学习一应俱全

参加 2018 AI开发者大会&#xff0c;请点击大会官网 译者 | 林椿眄、Jane 责编 | Jane 出品 | AI科技大本营 【导读】作者整理了近期最新发布及更新的 12 个非常有学习和收藏意义的开源项目。这些项目中包括基于 TensorFlow 的强化学习框架&#xff1b;可以对数据进行结构化处…

CentOS6.5下Gunicorn+Django+nginx部署的过程

2019独角兽企业重金招聘Python工程师标准>>> 本文假设你已经在CentOS下使用Python manage.py runserver 0.0.0.0:8080&#xff0c;能够顺利跑起来&#xff0c;并且被外网访问到了。项目名假设为&#xff1a;blog_project 安装nginx yum -y install nginx 如果安装不…

c7pro android7,三星c7pro和iphone7哪个值得买?三星Galaxy c7 pro和苹果iphone7区别对比详细评测...

三星c7 pro介绍&#xff1a;三星C7 Pro三星C7 Pro可以看作是去年底上市的三星C9 Pro低配版&#xff0c;屏幕变小了&#xff0c;硬件配置也有所降低&#xff0c;不过配备了骁龙625升级版的骁龙626处理器&#xff0c;硬件方面也是颇具看点的&#xff0c;以下是手机详细参数。三星…

NIPS2018 | 腾讯AI Lab入选20篇论文,含2篇Spotlight

1.7亿条数据&#xff0c;比胡同和撸串更真实的北京35岁IT老兵&#xff0c;转型AI&#xff0c;我做错了吗&#xff1f;厉害了&#xff0c;天刚一冷程序员就都换上了衬衫……如何用Python&Fabric打造区块链“淘宝”商城Python 3 字符串中的 STR 和 Bytes 究竟有什么区别&…

windows查看端口占用以及关闭相应的进程

开始--运行--cmd 进入命令提示符 输入netstat -ano 即可看到所有连接的PID 之后在任务管理器中找到这个PID所对应的程序如果任务管理器中没有PID这一项,可以在任务管理器中选"查看"-"选择列" 经常&#xff0c;我们在启动应用的时候发现系统需要的端…

bzoj 2730: [HNOI2012]矿场搭建——tarjan求点双

Description 煤矿工地可以看成是由隧道连接挖煤点组成的无向图。为安全起见&#xff0c;希望在工地发生事故时所有挖煤点的工人都能有一条出路逃到救援出口处。于是矿主决定在某些挖煤点设立救援出口&#xff0c;使得无论哪一个挖煤点坍塌之后&#xff0c;其他挖煤点的工人都有…

华为鸿蒙手机官网价格表,曝下半年华为将推出两款鸿蒙手机:国内独享,价格良心...

虽然发声表示自己将全力支持安卓系统&#xff0c;维护安卓生态&#xff0c;但又推出了鸿蒙操作系统&#xff0c;余承东还表示鸿蒙系统取代安卓系统只需要1-2天即可。从这番表态来看&#xff0c;华为应该后续是要安卓鸿蒙两手抓了。安卓系统照常使用&#xff0c;而鸿蒙系统也会进…

PocketPC 全屏的实现

在windows mobile 5.0中实现全屏的方法&#xff0c;和隐藏SIP的方法差不多&#xff0c;只要稍稍改一下就可以了&#xff1a;::CommandBar_Show(m_hWnd, FALSE);//隐藏菜单 ::SHFullScreen(m_hWnd,SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);//隐藏taskbar与sipSetForegroundWindo…

AI时代,谈数据分析时我们要谈些什么?

参加 2018 AI开发者大会&#xff0c;请点击大会官网 说起数据分析&#xff0c;你能想到的是什么&#xff1f; 根据维基百科的定义&#xff0c;数据分析是一类统计方法&#xff0c;其主要特点是多维性和描述性。有些几何方法有助于揭示不同的数据之间存在的关系&#xff0c;并绘…

清瘦的记录者: 一个比dbutils更小巧、好用的的持久化工具

https://gitee.com/bitprince/memory 1. 概述 1.1 连接、语句和结果集 从JDBC的规范上看&#xff0c;其对数据访问层有相当简洁的抽象&#xff1a;1、连接(connection) 2、语句(statement)、3结果集(result set)。我们对数据库做的事情无非&#xff1a;连接数据库&#xff0c;执…