GUI编程(函数解析以及使用)

1.介绍

AWT(Abstract Window Toolkit)和Swing 是 Java 提供的用于创建图形用户界面(GUI)的类库。

  1. AWT:AWT 是 Java 最早提供的 GUI 类库,它基于本地平台的窗口系统,使用操作系统的原生组件进行界面渲染。AWT 提供了一系列的类和方法,用于创建窗口、按钮、文本框等 GUI 组件,并处理用户事件。AWT 的组件和事件模型与底层平台密切相关,因此在不同的平台上可能会有差异。

  2. Swing:Swing 是建立在 AWT 之上的一个 GUI 类库,它完全由 Java 编写,不依赖于底层平台。Swing 提供了一套丰富的可定制的轻量级组件,如 JFrame、JButton、JTextField 等,并且具有更好的外观和跨平台的一致性。Swing 的组件和事件模型相对于 AWT 更加灵活,可以自定义绘制和样式。

区别:

  • 组件外观:AWT 使用本地平台的原生组件,而 Swing 使用纯 Java 实现的组件。因此,Swing 组件的外观更加统一,并且可以自定义绘制和样式,而 AWT 组件外观受限于本地平台。

  • 跨平台性:由于 Swing 是纯 Java 实现的,它的外观和行为在不同平台上是一致的,而 AWT 的外观和行为可能因平台而异。

  • 功能扩展:Swing 提供了更多的组件和功能,例如树状组件、表格组件等。同时,Swing 也支持更多的布局管理器,可以实现更复杂的界面布局。

关于 Frame 和 JFrame:

  • Frame:Frame 是 AWT 中的一个顶层窗口类,继承自 Window 类。它是一个简单的窗口容器,可以用来创建应用程序的主窗口。Frame 可以包含其他的组件,如按钮、文本框等。

  • JFrame:JFrame 是 Swing 中的一个顶层窗口类,继承自 Frame 类。JFrame 拥有更丰富的特性和功能,例如可自定义的标题栏、菜单栏、工具栏等。同时,JFrame 也支持 Swing 的 Look and Feel,可以统一外观,并且可以进行更灵活的界面定制。

总体上,AWT 是 Java 最早的 GUI 类库,基于本地平台的原生组件,而 Swing 是建立在 AWT 之上的一套完全由 Java 实现的 GUI 类库,提供了更丰富的组件和功能,同时具备跨平台性和可定制性。Frame 是 AWT 的顶层窗口类,而 JFrame 是 Swing 的顶层窗口类,JFrame 比 Frame 提供了更多的特性和功能。

总结:AWT是基础,Swing是以AWT为基础的GUI类库。基本上就是以学习Swing为主了。

但是这并不意味着不用学AWT了,先学AWT有了基础之后,学Swing事半功倍。

2.AWT(abstract windows tool)

抽象窗口工具

1.包含了很多类和接口。

2.元素:窗口,按钮,文本框

3.包是java.awt

Frame的使用

简单的创建一个窗户

public class TestGUI {public static void main(String[] args) {Frame frame= new Frame("java图形界面窗口");//窗口是Frame类//需要设置可见性frame.setVisible(true);//设置窗口大小frame.setSize(400,400);//设置背景颜色frame.setBackground(new Color(85,150,68));//r,g,b//弹出的初始位置frame.setLocation(200,200);//设置窗口大小固定frame.setResizable(false);//false是不可以改变//不写的话默认为true,可改变}

想创建一个窗口要写这么多代码,很麻烦,我们可以自己写一个类继承Frame,然后写一些方法,便于创造多个窗口

class MyFrame extends Frame{static int id = 0;//可能存在多个窗口,我们需要一个计数器public MyFrame(int x,int y,int w,int h,Color c) {super("MyFrame"+(++id));//调用父类的构造方法setBackground(c);setBounds(x,y,w,h);//等同于setLocation和setSize的结合setVisible(true);}}public class TestGUI {public static void main(String[] args) {MyFrame f1 = new MyFrame(100,100,200,200,Color.blue);MyFrame f2 = new MyFrame(100,100,200,200,Color.black);MyFrame f3 = new MyFrame(100,100,200,200,Color.cyan);MyFrame f4 = new MyFrame(100,100,200,200,Color.green);MyFrame f5 = new MyFrame(100,100,200,200,Color.red);}}

面板Panel

Panel可以看成是一个空间,但是不能单独存在,需要内嵌在Frame里、

以下代码实现内嵌panel,还有创建一个监听事件->监听窗口关闭事件

public class TestGUI {public static void main(String[] args) {Frame frame = new Frame();//布局的概念//可以内嵌一个个面板Panel panel = new Panel();//设置布局,下一块内容详细介绍frame.setLayout(null);//流布局frame.setBounds(300,300,500,500);frame.setBackground(new Color(40,161,35));//设置panel坐标(相对于frame)panel.setBounds(50,50,400,400);panel.setBackground(new Color(193,15,60));//在frame中加入该面板frame.add(panel);frame.setVisible(true);//创建一个监听事件->监听窗口关闭事件 System.exit(0)//这种写法显然太臃肿了,要重写所有方法//但我们现在只想关闭窗口,所以只需要windowClosing这个方法/*frame.addWindowListener(new WindowListener() {@Overridepublic void windowOpened(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowIconified(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowDeiconified(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowDeactivated(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowClosing(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowClosed(WindowEvent e) {// TODO Auto-generated method stub}@Overridepublic void windowActivated(WindowEvent e) {// TODO Auto-generated method stub}});*///因此我们可以用,适配器模式,只对我们需要的方法进行重写frame.addWindowListener(new WindowAdapter() {@Override//在这个方法里写,窗口关闭的时候要做的事情public void windowClosing(WindowEvent e) {// TODO Auto-generated method stubSystem.exit(0);}});}}

适配器模式

布局管理器

有以下几种布局

  • 流式布局(FlowLayout)
  • 边界布局(BorderLayout),也叫东西南北中
  • 表格布局(GridLayout)

这里引入Button,来体现布局

流式布局

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {Frame frame = new Frame();frame.setVisible(true);frame.setBounds(400,400,400,400);frame.setBackground(Color.GREEN);frame.setLayout(new FlowLayout(FlowLayout.CENTER));//可以选择左右上下中Button b1 = new Button("b1");Button b2 = new Button("b2");Button b3 = new Button("b3");Button b4 = new Button("b4");Button b5 = new Button("b5");frame.add(b1);frame.add(b2);frame.add(b3);frame.add(b4);frame.add(b5);}
}

边界布局

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {Frame frame = new Frame("TestBorderLayout");frame.setVisible(true);frame.setBounds(400,400,400,400);frame.setBackground(Color.GREEN);Button east = new Button("east");Button west = new Button("west");Button south = new Button("south");Button north = new Button("north");Button center = new Button("center");frame.add(center,BorderLayout.CENTER);frame.add(east,BorderLayout.EAST);frame.add(west,BorderLayout.WEST);frame.add(north,BorderLayout.NORTH);frame.add(south,BorderLayout.SOUTH);}
}

表格布局(GridLayout)

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {Frame frame = new Frame("TestBorderLayout");frame.setVisible(true);frame.setBounds(400,400,400,400);frame.setBackground(Color.GREEN);Button b1 = new Button("b1");Button b2 = new Button("b2");Button b3 = new Button("b3");Button b4 = new Button("b4");Button b5 = new Button("b5");Button b6 = new Button("b6");frame.setLayout(new GridLayout(3,2));//核心代码frame.add(b1);frame.add(b2);frame.add(b3);frame.add(b4);frame.add(b5);frame.add(b6);//frame.pack();//自动填充,也可以不用}
}

总结练习

设计下图窗口

package demo;
import java.util.*;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.Random;
import java.util.Arrays;
import javax.swing.*;
import javax.swing.border.Border;import java.awt.*;
import java.awt.*;
import java.awt.event.*;public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {Frame frame = new Frame("ExDemo");frame.setVisible(true);frame.setBounds(400,400,800,500);frame.setLayout(new GridLayout(2,1));//先写上面的Panel p1 = new Panel(new BorderLayout());//要用边界布局,后续在p1里布置东,西,中Panel p2 = new Panel(new GridLayout(2,1));p1.add(new Button("west-1"),BorderLayout.WEST);p1.add(new Button("east-1"),BorderLayout.EAST);p2.add(new Button("p2-btn-1"));p2.add(new Button("p2-btn-2"));p1.add(p2,BorderLayout.CENTER);//再写下面的Panel p3 = new Panel(new BorderLayout());Panel p4 = new Panel(new GridLayout(2,2));p3.add(new Button("west-2"),BorderLayout.WEST);p3.add(new Button("east-2"),BorderLayout.EAST);for(int i = 1;i<=4;i++) {p4.add(new Button("p4-btn-"+i));}p3.add(p4,BorderLayout.CENTER);frame.add(p1);frame.add(p3);}
}

事件监听

3.Swing

JFrame

JFrame:JFrame 是 Swing 中的一个顶层窗口类,继承自 Frame 类。

这意味着Frame的操作和方法基本在JFrame都能用,但有些还是有所区别的。

例如:Frame可以用setBackground设置背景颜色,而JFrame不行,

在Swing中,JFrame是继承自Frame的顶层窗口组件,但是它重写了父类Frame的设置背景颜色的方法。在JFrame中并没有提供直接设置背景颜色的方法,因为Swing更多地依赖于Look and Feel和视觉外观管理器(UIManager)来控制组件的外观和感觉。因此,想要设置JFrame的背景颜色,通常需要使用其他组件或技术来实现,比如在contentPane上添加一个背景色为指定颜色的面板。

接下来开始正式介绍了

构造方法

无参构造

JFrame jf = new JFrame();

jf.setTitle("TestJF");

有参构造

JFrame jf = new JFrame("TestJF");

无参构造可以配合setTitle来设置标题

参数设置及常用方法


setTitle("窗体名称");
用来设置窗口名字

setSize(int width, int height);
这个方法用来设置窗体的大小,传入宽高即可。

setLocation(int x, int y);
这个方法用来设置窗体的坐标(原点在左上角),传入坐标即可。

setBounds(int x, int y, int width, int height);
看这玩意的参数你就大概猜得到,没错它就是上面②和①的整合版。

setVisible(boolean b);
用来设置窗体是否可见,默认是不可见的,所以要可见必须用这个方法传入参数true。

setDefaultCloseOperation(int opreation);
用来设置点击窗体关闭按钮的时候,做出的响应。通常都是如下面这样写(调用WindowConstants这个类中的静态成员EXIT_ON_CLOSE,表示点击关闭按钮时的默认响应为关闭此窗口并结束程序)。

fr.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);


WindowConstants的相关静态成员如下:

DO_NOTHING_ON_CLOSE(什么也不做)
HIDE_ON_CLOSE (隐藏当前窗口)
DISPOSE_ON_CLOSE (隐藏当前窗口,并释放窗体占有的其他资源,这个重点记一下,后面讲JDialog会用到)
EXIT_ON_CLOSE (结束窗口所在的应用程序)。
 

例题

创建一个窗口

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("TestJF");jf.setBounds(400,400,400,400);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);}
}

JDialog

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("TestJF");jf.setTitle(null);jf.setVisible(true);jf.setBounds(400,400,400,400);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);JDialog jd = new JDialog(jf,"TestJD");jd.setBounds(450,450,100,100);jd.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);jd.setModal(true);//设置模态窗口jd.setVisible(true);}
}

JPanel

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("Test");jf.setBounds(400,400,400,400);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);JPanel p = new JPanel();JButton b1 = new JButton("b1");JButton b2 = new JButton("b2");JButton b3 = new JButton("b3");JButton b4 = new JButton("b4");p.add(b1);p.add(b2);p.add(b3);p.add(b4);jf.add(p);}
}

JScrollPanel

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("Test");jf.setBounds(400,400,400,400);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);JPanel p = new JPanel();JButton b1 = new JButton("b1");JButton b2 = new JButton("b2");JButton b3 = new JButton("b3");JButton b4 = new JButton("b4");p.add(b1);p.add(b2);p.add(b3);p.add(b4);jf.add(p);JScrollPane jsp = new JScrollPane();jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);jsp.setViewportView(p);jf.add(jsp);}
}

JLabel

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("Test");jf.setBounds(400,400,400,400);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);JPanel p = new JPanel();JLabel label = new JLabel("插入标签");p.add(label);jf.add(p);}
}

JTextField

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("Test");jf.setBounds(400,400,500,500);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);JPanel p = new JPanel();JTextField jt = new JTextField(40);//设置文本框列数,也就是设置长度p.add(jt);jf.add(p);}
}

JTextArea

public class Main {public static void main(String[] args) throws InterruptedException, ExecutionException {JFrame jf = new JFrame("Test");jf.setBounds(400,400,500,500);jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);jf.setVisible(true);JPanel p = new JPanel();JTextArea jt = new JTextArea(5,20);//设置文本框列数,也就是设置长度p.add(jt);jf.add(p);}
}

JButton

跟AWT的Button没什么区别,不赘述了

例题

public class Main {public static void createGUI() {JFrame fr = new JFrame("这是主窗口");//通常直接在有参构造的时候命名,省得后续用setTitle()方法命名了。fr.setSize(400, 250);//设置窗体宽高fr.setLocation(400, 300);//设置窗体坐标fr.setVisible(true);//设置窗体可见,基本必写吧?fr.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//设置窗体关闭按钮响应事件为关闭此窗口。//以下是重点JPanel pane = new JPanel();JLabel label = new JLabel("请输入:");JTextField textField = new JTextField(20);JButton button = new JButton("发送");pane.add(label);pane.add(textField);pane.add(button);//把容器放在窗口中fr.add(pane);}public static void main(String[] args) {createGUI();}
}

事件监听和处理

重点掌握:实现ActionListener这个接口,并重写其中的actionPerformed方法(这个方法就固定接收一个ActionEvent类)

例如:

class my_listenr implements ActionListener{@Overridepublic void actionPerformed(ActionEvent e) {//传入的参数是事件// TODO Auto-generated method stubSystem.out.println("按钮被点击");}}

例题

实现一个功能,点击按钮,会输出“按钮被点击”.

方法一:自定义类实现

class my_listenr implements ActionListener{@Overridepublic void actionPerformed(ActionEvent e) {//传入的参数是监听事件// TODO Auto-generated method stubSystem.out.println("按钮被点击");}}public class Main {public static void createGUI() {JFrame fr = new JFrame("这是主窗口");//通常直接在有参构造的时候命名,省得后续用setTitle()方法命名了。fr.setSize(400, 250);//设置窗体宽高fr.setLocation(400, 300);//设置窗体坐标fr.setVisible(true);//设置窗体可见,基本必写吧?fr.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//设置窗体关闭按钮响应事件为关闭此窗口。JPanel p = new JPanel();JButton b = new JButton("按钮");b.addActionListener(new my_listenr());p.add(b);fr.add(p);}public static void main(String[] args) {createGUI();}
}

方法二:匿名内部类实现

实际上,每个按钮的功能一般都不一样,如果有多个按钮,用方法一的话就要自定义多个类,太冗余了,因此我们可以用匿名内部类实现。

对这个知识点不熟悉的可以看-> 匿名内部类

public class Main {public static void createGUI() {JFrame fr = new JFrame("这是主窗口");//通常直接在有参构造的时候命名,省得后续用setTitle()方法命名了。fr.setSize(400, 250);//设置窗体宽高fr.setLocation(400, 300);//设置窗体坐标fr.setVisible(true);//设置窗体可见,基本必写吧?fr.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//设置窗体关闭按钮响应事件为关闭此窗口。JPanel p = new JPanel();JButton b = new JButton("按钮");//匿名内部类实现b.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {// TODO Auto-generated method stubSystem.out.println("按钮被点击");}});p.add(b);fr.add(p);}public static void main(String[] args) {createGUI();}
}

效果与方法一相同

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/628050.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

文件的创建时间可以修改吗,怎么改?

文件的创建时间可以修改吗&#xff0c;怎么改&#xff1f;文件的创建时间是由操作系统自动生成并记录的&#xff0c;通常情况下无法直接修改。创建时间是文件的属性之一&#xff0c;它反映了文件在文件系统中的生成时间。一旦文件被创建&#xff0c;其创建时间就被确定下来&…

Vulnhub-tr0ll-1

一、信息收集 端口收集 PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.2 | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rwxrwxrwx 1 1000 0 8068 Aug 09 2014 lol.pcap [NSE: writeable] | ftp-syst: | STAT: | FTP …

分布式搜索——Elasticsearch

Elasticsearch 文章目录 Elasticsearch简介ELK技术栈Elasticsearch和Lucene 倒排索引正向索引倒排索引正向和倒排 ES概念文档和字段索引和映射Mysql与Elasticsearch 安装ES、Kibana安装单点ES创建网络拉取镜像运行 部署kibana拉取镜像部署 安装Ik插件扩展词词典停用词词典 索引…

Linux 内核大转变:是否将迈入现代 C++ 的时代?

Linux开发者 H. Peter Anvin 在邮件列表中重启了关于 Linux内核C代码转换为C的讨论&#xff0c;并陈述了自己的观点。说之前先看一下这个话题的历史背景。 早在2018年4月1日&#xff0c;Andrew Pinski提议将 Linux 内核源码转为 C&#xff0c;在文中写道之所以引入是由于以下优…

centos7配置时间同步网络时间

centos7配置时间同步网络时间 1、安装 NTP 工具。 sudo yum install -y ntp2启动 NTP 服务。 sudo systemctl start ntpd3、将 NTP 服务设置为开机自启动。 sudo systemctl enable ntpd4、验证 date

Xmind 网页端登录及多端同步

好久没用 Xmind 了&#xff0c;前几天登录网页端突然发现没办法登录了&#xff0c;总是跳转到 Xmind AI 页面。本以为他们不再支持网页端了&#xff0c;后来看提示才知道只是迁移到了新的网址&#xff0c;由原来的 xmind.works 现在改成了的 xmind.ai。又花费好长时间才重新登录…

JAVAEE——request对象(三)

1. request对象 1.1 知识点 &#xff08;1&#xff09;乱码问题的两种解决方式 &#xff08;2&#xff09;post和get提交的区别 &#xff08;3&#xff09;request接收同名参数的问题 1.2 具体内容 使用request接收参数 <%page contentType"text/html; charsetut…

探索2023年大模型与AIGC峰会:程序员的学习之旅与未来展望

在2023年的技术前沿&#xff0c;大模型与AIGC峰会无疑是一个备受瞩目的盛会。 作为程序员&#xff0c;你将从这次大会中学到什么&#xff1f;这次峰会将为你揭示哪些前沿科技趋势&#xff1f;让我们一起来探讨这个问题。 一、理解大模型与AIGC 大模型和AIGC是人工智能领域中两…

离线数据仓库-关于增量和全量

数据同步策略 数据仓库同步策略概述一、数据的全量同步二、数据的增量同步三、数据同步策略的选择 数据仓库同步策略概述 应用系统所产生的业务数据是数据仓库的重要数据来源&#xff0c;我们需要每日定时从业务数据库中抽取数据&#xff0c;传输到数据仓库中&#xff0c;之后…

x-cmd pkg | mermaid - 流程图、时序图等图表绘制工具

简介 mermaid-cli 是由 Mermaid 官方提供的命令行工具&#xff0c;用于将 Mermaid 语法的文本转换为 SVG / PNG / PDF。 Mermaid 是一个基于 JavaScript 的图表绘制工具&#xff0c;它使用简单的文本描述语法&#xff0c;就可以绘制出流程图、时序图、甘特图等多种图表。 首次…

C++标准学习--智能指针

shared_ptr和weak_ptr的配合使用是个问题。unique_ptr的使用场合似乎比较局限。 文章C 智能指针详解&#xff08;一&#xff09;——unique_ptr - 知乎 (zhihu.com) 介绍了unique_ptr的使用。它可以由shared_ptr转来&#xff0c;主要用到了std::move。 主要场景其中提到&#…

ES数据聚合

1.数据聚合 聚合&#xff08;aggregations&#xff09;可以让我们极其方便的实现对数据的统计、分析、运算。例如&#xff1a; 什么品牌的手机最受欢迎&#xff1f; 这些手机的平均价格、最高价格、最低价格&#xff1f; 这些手机每月的销售情况如何&#xff1f; 实现这些…

【JaveWeb教程】(24) Mybatis入门之Mybatis配置与SQL语句编写 详细代码示例讲解(最全面)

目录 Mybatis入门前言1. 快速入门1.1 入门程序分析1.2 入门程序实现1.2.1 准备工作1.2.1.1 创建springboot工程1.2.1.2 数据准备 1.2.2 配置Mybatis1.2.3 编写SQL语句1.2.4 单元测试 1.3 解决SQL警告与提示 Mybatis入门 前言 在前面我们学习MySQL数据库时&#xff0c;都是利用…

解决文库系统 本地转码 libreoffice中文乱码的问题(mkfontscale mkfontdir fc-cache -fv命令)

安装搭建好的文库系统在使用Linux系统libreoffice时&#xff0c;如果系统安装时没有安装中文字体库或者中文字体字库不全&#xff0c;将会导致无法正常生成和显示中文 文库系统中文乱码 转码问题处理好之后的效果&#xff1a; 现在中文显示就正常了 1、要查看系统中已经安…

Vue学习笔记3--全局事件总线

Vue学习笔记3—全局事件总线 1.全局事件总线可以实现任意组件间通信 X需具备的条件&#xff1a; 所有的组件都要能看见X可以调用$on $off $emitVue.prototype.x {a:1, b:2} 可以被所有组件看见VueComponent.protoype.proto Vue.prototype组件实例对象(vc)可以访问到Vue原型上…

Java重修第六天—面向对象3

通过学习本篇文章可以掌握如下知识 1、多态&#xff1b; 2、抽象类&#xff1b; 3、接口。 之前已经学过了继承&#xff0c;static等基础知识&#xff0c;这篇文章我们就开始深入了解面向对象多态、抽象类和接口的学习。 多态 多态是在继承/实现情况下的一种现象&#xf…

Python+Django+MySQL的图书馆管理系统【附源码,运行简单】

PythonDjangoMySQL的图书馆管理系统【附源码&#xff0c;运行简单】 总览 1、《图书馆管理系统》1.1 方案设计说明书设计目标需求分析工具列表 2、详细设计2.1 登录2.2 注册2.3 程序主页面2.4 图书新增界面2.5 图书信息修改界面2.6 其他功能贴图 3、下载 总览 自己做的项目&am…

BLHeli_S 代码分析---BLHeli.asm入口函数pgm_start分析

BLHeli_S 代码分析—BLHeli.asm入口函数pgm_start分析 pgm_start 代码 代码中数据变量定义 Bit_Access: DS 1Flash_Key_1: DS 1 ; Flash key one Flash_Key_2: DS 1 ; Flash key twoAIKON_Boltlite_30A.inc文件中定义的变量 LOCK_BYTE_ADDRESS_16K EQU 3FFFh ; Ad…

运筹说 第56期 | 整数规划的数学模型割平面法

前几章讨论过的线性规划问题的一个共同特点是&#xff1a;最优解的取值可以是分数或者小数。然而&#xff0c;在许多实际问题中&#xff0c;决策者要求最优解必须是整数&#xff0c;例如公交车的车辆数、员工的人数、机器的台数、产品的件数等。那么&#xff0c;我们能否将得到…

【Spring 篇】走进SpringMVC的世界:舞动Web的激情

嗨&#xff0c;亲爱的小白们&#xff01;欢迎来到这篇关于SpringMVC的博客&#xff0c;让我们一起探索这个舞动Web的框架&#xff0c;感受它带来的激情和便利。在这个世界里&#xff0c;我们将学到SpringMVC的概述、开发步骤以及如何快速入门&#xff0c;一切都是如此的令人兴奋…