欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于java實(shí)現(xiàn)畫圖板功能

 更新時間:2022年01月11日 07:50:27   作者:l0919160205  
這篇文章主要為大家詳細(xì)介紹了基于java實(shí)現(xiàn)畫圖板功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了java實(shí)現(xiàn)畫圖板功能的具體代碼,供大家參考,具體內(nèi)容如下

一、介紹

這個畫圖板主要實(shí)現(xiàn)的功能是畫矩形(矩形使用的是一個函數(shù)畫圖的方法,這樣畫出來的圖形比較有特點(diǎn))、橢圓、多變形(先畫一條直線,鼠標(biāo)每點(diǎn)擊一個地方就會從上一個點(diǎn)連接到點(diǎn)擊的點(diǎn),當(dāng)鼠標(biāo)雙擊時,雙擊的點(diǎn)會和終點(diǎn)和起點(diǎn)相連)、畫線、橡皮以及顏色選擇器,效果圖如下所示:

二、具體實(shí)現(xiàn)

本項目主要使用的是java.swing以及java.awt的畫圖工具來實(shí)現(xiàn)。首先顯示窗口的建立,先讓主類draw繼承javax.swing.JFrame。draw.java的代碼如下:

public class draw extends JFrame{

?? ?private Shape shape[]= new Shape[100000];//將所畫的形狀存儲在shape數(shù)組中
?? ?public static void main(String[] args) {
?? ??? ?draw simpleDraw = new draw();
?? ??? ?simpleDraw.showUI();//調(diào)用showUI()函數(shù)

?? ?}
?? ?public void showUI() {
?? ??? ?drawlistener drawListener = new drawlistener();
?? ??? ?
?? ??? ?
?? ??? ?java.awt.FlowLayout flowLayout = new FlowLayout();
?? ??? ?JButton jb1=new JButton("矩形");//添加一個叫“矩形”的按鈕
?? ??? ?JButton jb2=new JButton("橢圓");
?? ??? ?JButton jb3=new JButton("多邊形");
?? ??? ?JButton jb4=new JButton("三角形");
?? ??? ?JButton jb5=new JButton("畫線");
?? ??? ?JButton jb6=new JButton("橡皮");
?? ??? ?java.awt.Dimension dimension = new Dimension(100, 30);
?? ??? ?jb1.setPreferredSize(dimension);//設(shè)置按鈕的位置
?? ??? ?jb2.setPreferredSize(dimension);
?? ??? ?jb3.setPreferredSize(dimension);
?? ??? ?jb4.setPreferredSize(dimension);
?? ??? ?jb5.setPreferredSize(dimension);
?? ??? ?jb6.setPreferredSize(dimension);
?? ??? ?this.add(jb1);//在這個窗口上添加按鈕
?? ??? ?this.add(jb2);
?? ??? ?this.add(jb3);
?? ??? ?this.add(jb4);
?? ??? ?this.add(jb5);
?? ??? ?this.add(jb6);
?? ??? ?Color []colors= {Color.BLUE,Color.GRAY,Color.YELLOW,Color.BLACK};//提供四種顏色選擇,存儲在colors數(shù)組中
?? ??? ?for(int i=0;i<4;i++) {//新建4個顏色選擇的按鈕
?? ??? ??? ?JButton jButton=new JButton();
?? ??? ??? ?jButton.setBackground(colors[i]);
?? ??? ??? ?jButton.setPreferredSize(new Dimension(30, 30));
?? ??? ??? ?this.add(jButton);//在這個窗口上添加次按鈕
?? ??? ??? ?jButton.addActionListener(drawListener);//設(shè)置按鈕的位置
?? ??? ?}
?? ??? ?
?? ??? ?this.setLayout(flowLayout);//設(shè)置窗口布局
?? ??? ?this.setSize(800, 700);//設(shè)置窗口大小
?? ??? ?this.setTitle("畫板");//設(shè)置窗口名稱
?? ??? ?this.setLocationRelativeTo(null);//設(shè)置窗口位置
?? ??? ?this.setDefaultCloseOperation(3);
?? ??? ?this.setVisible(true);
?? ??? ?this.getContentPane().setBackground(Color.white);//設(shè)置窗口背景顏色
?? ??? ?
?? ??? ?
?? ??? ?this.addMouseMotionListener(drawListener);//窗口添加監(jiān)聽
?? ??? ?jb1.addActionListener(drawListener);//按鈕添加監(jiān)聽
?? ??? ?jb2.addActionListener(drawListener);
?? ??? ?jb3.addActionListener(drawListener);
?? ??? ?jb4.addActionListener(drawListener);
?? ??? ?jb5.addActionListener(drawListener);
?? ??? ?jb6.addActionListener(drawListener);
?? ??? ?//-----------------
?? ??? ?java.awt.Graphics g = this.getGraphics();//在此窗口上獲得畫筆
?? ??? ?
?? ??? ?drawListener.setGr(g);//將畫筆傳給監(jiān)聽器drawListener
?? ??? ?drawListener.setShape(shape);//將數(shù)組傳給監(jiān)聽器drawListener
?? ??? ?this.addMouseListener(drawListener);//畫布添加監(jiān)聽
?? ??? ?
?? ??? ?
?? ?}
?? ?public void paint(Graphics g) {//重繪
?? ??? ?super.paint(g);
?? ??? ?for(int i=0;i<shape.length;i++) {//重繪shape數(shù)組中的所有圖形
?? ??? ??? ?Shape shape1=shape[i];
?? ??? ??? ?if(shape1!=null) {
?? ??? ??? ??? ?shape1.drawShape(g);
?? ??? ??? ?}else
?? ??? ??? ??? ?break;
?? ??? ?}
?? ?}
}

上述代碼中showUI()函數(shù)是畫圖板的界面,drawlistener drawListener = new drawlistener();是調(diào)用drawlistener.java新建一個drawlistener類。
在項目進(jìn)行的過程中,將窗口最小化或者改變窗口大小時,我們先前畫的東西就全部消失了。這是因為當(dāng)窗體在屏幕上顯示的時候,首先是將窗體對象的數(shù)據(jù)從內(nèi)存中取出來放到緩存中,再在屏幕上進(jìn)行繪制。當(dāng)窗體發(fā)生改變的時候,程序就會重新從內(nèi)存中獲取更新后的數(shù)據(jù)繪制。**在系統(tǒng)中Jframe的父類中提供有一個paint(Graphics g)的方法來負(fù)責(zé)將窗口數(shù)據(jù)在屏幕上繪制出來。**所以我重寫了paint(Graphics g)方法,先將畫過的圖形存儲在一個shape數(shù)組中,然后在paint(Graphics g)方法中將所有圖形重新畫出來,代碼:

public void paint(Graphics g) {//重繪
?? ??? ?super.paint(g);
?? ??? ?for(int i=0;i<shape.length;i++) {//重繪shape數(shù)組中的所有圖形
?? ??? ??? ?Shape shape1=shape[i];
?? ??? ??? ?if(shape1!=null) {
?? ??? ??? ??? ?shape1.drawShape(g);
?? ??? ??? ?}else
?? ??? ??? ??? ?break;
?? ??? ?}
?? ?}

drawlistener.java代碼如下:

public class drawlistener implements MouseListener,ActionListener,MouseMotionListener{

?? ?private int x1,x2,y1,y2,x3,y3,a,b,x4,y4;
?? ?private Graphics gr;?? ?
?? ?private int flag=1;
?? ?String name;
?? ?Shape shapeLarry[];
?? ?int index;
?? ?Color c=Color.BLACK;

?? ?
?? ?public void setShape(Shape shape[]) {//傳入shape數(shù)組
?? ??? ?this.shapeLarry=shape;
?? ?}
?? ?public void setGr(Graphics graphics) {//傳入畫筆
?? ??? ?gr=graphics;
?? ?}

?? ?public void mouseClicked(MouseEvent e) {//重寫鼠標(biāo)點(diǎn)擊函數(shù)mouseClicked(MouseEvent e)
?? ??? ?x3=e.getX();//獲取鼠標(biāo)x坐標(biāo)
?? ??? ?y3=e.getY();//獲取鼠標(biāo)y坐標(biāo)
?? ??? ?if("多邊形".equals(name)) {//如果點(diǎn)擊多邊形按鈕
?? ??? ??? ?if(flag == 2) {//如果是第一次畫
?? ??? ??? ??? ?//gr.drawLine(x3, y3, x1, y1);
?? ??? ??? ??? ?gr.drawLine(x3, y3, x2, y2);
?? ??? ??? ??? ?Shape shape=new Shape(x3, x2, y3, y2, name);
?? ??? ??? ??? ?shape.setColor(c);
?? ??? ??? ??? ?shapeLarry[index++]=shape;
?? ??? ??? ??? ?a=x3;
?? ??? ??? ??? ?b=y3;
?? ??? ??? ??? ?flag++;
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?if(flag==3) {//如果不是第一次畫
?? ??? ??? ??? ?gr.drawLine(x3, y3, a, b);
?? ??? ??? ??? ?Shape shape=new Shape(x3, a, y3, b, name);
?? ??? ??? ??? ?shape.setColor(c);
?? ??? ??? ??? ?shapeLarry[index++]=shape;
?? ??? ??? ??? ?a=x3;
?? ??? ??? ??? ?b=y3;
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?if(e.getClickCount()==2) {//如果雙擊,連接起點(diǎn)終點(diǎn)
?? ??? ??? ??? ?gr.drawLine(x3, y3, x1, y1);
?? ??? ??? ??? ?Shape shape=new Shape(x3, x1, y3, y1, name);
?? ??? ??? ??? ?shape.setColor(c);
?? ??? ??? ??? ?shapeLarry[index++]=shape;
?? ??? ??? ??? ?gr.drawLine(x3, y3, a, b);
?? ??? ??? ??? ?
?? ??? ??? ??? ?flag-=2;
?? ??? ??? ?}
?? ??? ?}
?? ??? ?if("三角形".equals(name)) {//如果點(diǎn)擊三角形按鈕
?? ??? ??? ?if(flag==2) {//如果不是第一次畫,連接兩端
?? ??? ??? ??? ?gr.drawLine(x3, y3, x1, y1);
?? ??? ??? ??? ?Shape shape=new Shape(x1, x3, y1, y3, name);
?? ??? ??? ??? ?shape.setColor(c);
?? ??? ??? ??? ?shapeLarry[index++]=shape;
?? ??? ??? ??? ?gr.drawLine(x3, y3, x2, y2);
?? ??? ??? ??? ?Shape shape2=new Shape(x2, x3, y2, y3, name);
?? ??? ??? ??? ?shape2.setColor(c);
?? ??? ??? ??? ?shapeLarry[index++]=shape2;
?? ??? ??? ??? ?flag--;
?? ??? ??? ?}
?? ??? ?}
?? ??? ?System.out.println("flag="+flag);
?? ??? ?
?? ?}

? ? public void mousePressed(MouseEvent e) {//重寫鼠標(biāo)持續(xù)點(diǎn)擊函數(shù)mousePressed(MouseEvent e)
? ? ?? ?if(flag == 1) {
?? ? ? ??? ?x1=e.getX();
?? ??? ??? ?y1=e.getY();
? ? ?? ?}
? ? ? ??
? ? ?? ?
? ? }

? ??
? ? public void mouseReleased(MouseEvent e){//重寫鼠標(biāo)釋放函數(shù)mouseReleased(MouseEvent e)
?? ? ? ?if(flag==1) {
?? ? ? ??? ?x2=e.getX();
?? ??? ??? ?y2=e.getY();
?? ? ? ?}

? ? ?? ?if("矩形".equals(name)) {//使用函數(shù)畫圖
? ? ?? ??? ?for(int i=0;i<25500;i++) {
? ? ?? ??? ??? ?gr.setColor(new Color(i/100, (i+12)/100, 12));
? ? ?? ??? ??? ?if((i+12)/100>=225) {
? ? ?? ??? ??? ??? ?for(int i2=i;i2<30000;i2++) {
? ? ?? ??? ??? ??? ??? ?gr.setColor(new Color(i/100, (i+12)/100, 12));
? ? ?? ??? ??? ??? ??? ?if((Math.abs(x2-x1)-i2/50)<=0||(Math.abs(y2-y1)-i2/50)<=0)
? ? ?? ??? ??? ??? ??? ??? ?break;
? ? ?? ??? ??? ??? ??? ?gr.drawRect(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1)-i2/50, Math.abs(y2-y1)-i2/50);
? ? ?? ??? ??? ??? ??? ?
? ? ?? ??? ??? ??? ?}
? ? ?? ??? ??? ??? ?break;
? ? ?? ??? ??? ?}
? ? ?? ??? ??? ?gr.drawRect(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1)-i/50, Math.abs(y2-y1)-i/50);
? ? ?? ??? ?}
? ? ?? ??? ?Shape shape= new Shape(x1, x2, y1, y2, name);
? ? ?? ??? ?shapeLarry[index++]=shape;
?? ??? ??? ?//gr.drawRect(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1));
?? ??? ?}
? ? ?? ?if("橢圓".equals(name)) {//當(dāng)鼠標(biāo)釋放時畫橢圓
?? ??? ??? ?gr.drawOval(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1));
?? ??? ??? ?Shape shape=new Shape(x1, x2, y1, y2, name);
?? ??? ??? ?shape.setColor(c);
?? ??? ??? ?shapeLarry[index++]=shape;
?? ??? ?}
? ? ?? ?if("多邊形".equals(name) && flag==1) {//當(dāng)鼠標(biāo)釋放時且不是最后一次畫時畫直線
? ? ? ? ?? ?gr.drawLine(x1, y1, x2, y2);
? ? ? ? ?? ?Shape shape=new Shape(x1, x2, y1, y2, name);
?? ??? ??? ?shape.setColor(c);
?? ??? ??? ?shapeLarry[index++]=shape;
? ? ? ? ?? ?flag++;
? ? ?? ?}
? ? ?? ?if("三角形".equals(name) && flag==1) {
?? ??? ??? ?gr.drawLine(x1, y1, x2, y2);?? ?
?? ??? ??? ?Shape shape=new Shape(x1, x2, y1, y2, name);
?? ??? ??? ?shape.setColor(c);
?? ??? ??? ?shapeLarry[index++]=shape;
? ? ?? ??? ?flag++;
? ? ?? ?}
? ? ?? ?if("橡皮".equals(name)) {
?? ??? ??? ?Graphics2D graphics2d=(Graphics2D) gr;
? ? ?? ??? ?BasicStroke basicStroke=new BasicStroke(1f);
? ? ?? ??? ?graphics2d.setColor(c);
? ? ?? ??? ?graphics2d.setStroke(basicStroke);
? ? ?? ?}
? ? ?? ?System.out.println("flag="+flag);
? ? }
?? ?public void actionPerformed(ActionEvent e) {
?? ??? ?if("".equals(e.getActionCommand())) {
?? ??? ??? ?JButton jb=(JButton)e.getSource();
?? ??? ??? ?c=jb.getBackground();
?? ??? ??? ?gr.setColor(c);
?? ??? ?}else if("多邊形".equals(e.getActionCommand())==false ||"三角形".equals(e.getActionCommand())==false){
?? ??? ??? ?flag=1;
?? ??? ??? ?name=e.getActionCommand();
?? ??? ?}else {
?? ??? ??? ?
?? ??? ??? ?name=e.getActionCommand();
?? ??? ?}

?? ?}

?? ?
?? ?public void mouseDragged(MouseEvent e) {//重寫鼠標(biāo)拖拽函數(shù)mouseDragged(MouseEvent e)
?? ??? ?x4=e.getX();
?? ??? ?y4=e.getY();
?? ??? ?if("畫線".equals(name)) {//畫線主要是下一個點(diǎn)和上一個點(diǎn)連線組成
?? ??? ??? ?
?? ??? ??? ?gr.drawLine(x1, y1,x4, y4);
?? ??? ??? ?Shape sh=new Shape(x4, y4, name, x1, y1);
?? ??? ??? ?sh.setColor(c);
?? ??? ??? ?shapeLarry[index++]=sh;
?? ??? ??? ?x1=x4;
?? ??? ? ? ?y1=y4;
?? ??? ??? ?
?? ??? ?}
? ? ? ? if("橡皮".equals(name)) {
?? ??? ??? ?Graphics2D graphics2d=(Graphics2D) gr;
?? ??? ??? ?BasicStroke basicStroke=new BasicStroke(10f);
?? ??? ??? ?graphics2d.setColor(Color.WHITE);
?? ??? ??? ?graphics2d.setStroke(basicStroke);
?? ??? ??? ?gr.drawLine(x1, y1,x4, y4);
?? ??? ??? ?Shape she=new Shape(x4, y4, name, x1, y1);
?? ??? ??? ?she.setColor(Color.white);
?? ??? ??? ?shapeLarry[index++]=she;
?? ??? ??? ?x1=x4;
?? ??? ? ? ?y1=y4;
?? ??? ?}
?? ??? ?if("矩形".equals(name)) {
?? ??? ??? ?
?? ??? ??? ?gr.drawRect(Math.min(x1, x4), Math.min(y1, y4), Math.abs(x4-x1), Math.abs(y4-y1));
?? ??? ??? ?gr.setColor(Color.white);
?? ??? ??? ?gr.drawRect(Math.min(x1, a), Math.min(y1, b), Math.abs(a-x1), Math.abs(b-y1));
?? ??? ??? ?gr.setColor(Color.black);
?? ??? ??? ?a=x4;
?? ??? ??? ?b=y4;
?? ??? ?}
?? ?}

}

Shape.java代碼如下:

public class Shape {
?? ?private int x1,x2,y1,y2,x3,y3,x4,y4,a,b;
?? ?String name;
?? ?Color c1;
?? ?
?? ?public Shape(int x1,int x2,int y1,int y2,String name) {
?? ??? ?this.x1=x1;
?? ??? ?this.x2=x2;
?? ??? ?this.y1=y1;
?? ??? ?this.y2=y2;
?? ??? ?this.name=name;
?? ?}
?? ?public Shape(int x4,int y4,String name,int x1,int y1) {
?? ??? ?this.x1=x1;
?? ??? ?this.y1=y1;
?? ??? ?this.x4=x4;
?? ??? ?this.y4=y4;
?? ??? ?this.name=name;
?? ?}
?? ?
?? ?public void setColor(Color c) {
?? ??? ?this.c1=c;
?? ??? ?
?? ?}
?? ??? ?
?? ?public void drawShape(Graphics g){
?? ??? ?g.setColor(c1);
?? ??? ?switch (name) {
?? ??? ?case "矩形":
?? ??? ??? ?for(int i=0;i<25500;i++) {
? ? ?? ??? ??? ?g.setColor(new Color(i/100, (i+12)/100, 12));
? ? ?? ??? ??? ?if((i+12)/100>=225) {
? ? ?? ??? ??? ??? ?for(int i2=i;i2<30000;i2++) {
? ? ?? ??? ??? ??? ??? ?g.setColor(new Color(i/100, (i+12)/100, 12));
? ? ?? ??? ??? ??? ??? ?if((Math.abs(x2-x1)-i2/50)<=0||(Math.abs(y2-y1)-i2/50)<=0)
? ? ?? ??? ??? ??? ??? ??? ?break;
? ? ?? ??? ??? ??? ??? ?g.drawRect(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1)-i2/50, Math.abs(y2-y1)-i2/50);
? ? ?? ??? ??? ??? ??? ?
? ? ?? ??? ??? ??? ?}
? ? ?? ??? ??? ??? ?break;
? ? ?? ??? ??? ?}
? ? ?? ??? ??? ?g.drawRect(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1)-i/50, Math.abs(y2-y1)-i/50);
? ? ?? ??? ?}
?? ??? ??? ?break;
?? ??? ??? ?
?? ??? ?case "橢圓":
?? ??? ??? ?Graphics2D graphics2d4=(Graphics2D) g;
? ? ?? ??? ?BasicStroke basicStroke4=new BasicStroke(1f);
? ? ?? ??? ?graphics2d4.setColor(c1);
? ? ?? ??? ?graphics2d4.setStroke(basicStroke4);
?? ??? ??? ?
?? ??? ??? ?g.drawOval(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1));
?? ??? ??? ?break;
?? ??? ?case "畫線":
?? ??? ??? ?Graphics2D graphics2d=(Graphics2D) g;
? ? ?? ??? ?BasicStroke basicStroke=new BasicStroke(1f);
? ? ?? ??? ?graphics2d.setColor(c1);
? ? ?? ??? ?graphics2d.setStroke(basicStroke);
? ? ?? ??? ?
?? ??? ??? ?g.drawLine(x1, y1, x4, y4);
?? ??? ??? ?break;
?? ??? ?case "橡皮":
?? ??? ??? ?Graphics2D g2D=(Graphics2D)g;
?? ??? ??? ?BasicStroke basicStroke2=new BasicStroke(10f);
?? ??? ??? ?g2D.setColor(Color.WHITE);
?? ??? ??? ?g2D.setStroke(basicStroke2);
?? ??? ??? ?
?? ??? ??? ?g2D.drawLine(x1, y1,x4, y4);
?? ??? ??? ?break;
?? ??? ?case "三角形":
?? ??? ??? ?Graphics2D graphics2d1=(Graphics2D) g;
? ? ?? ??? ?BasicStroke basicStroke1=new BasicStroke(1f);
? ? ?? ??? ?graphics2d1.setColor(c1);
? ? ?? ??? ?graphics2d1.setStroke(basicStroke1);
? ? ?? ??? ?
?? ??? ??? ?g.drawLine(x1, y1, x2, y2);
?? ??? ??? ?//g.drawLine(x3, y3, x1, y1);
?? ??? ??? ?//g.drawLine(x3, y3, x2, y2);
?? ??? ??? ?break;
?? ??? ?case "多邊形":
?? ??? ??? ?Graphics2D graphics2d2=(Graphics2D) g;
? ? ?? ??? ?BasicStroke basicStroke3=new BasicStroke(1f);
? ? ?? ??? ?graphics2d2.setColor(c1);
? ? ?? ??? ?graphics2d2.setStroke(basicStroke3);
? ? ?? ??? ?
?? ??? ??? ?g.drawLine(x1, y1, x2, y2);
?? ??? ??? ?break;
?? ??? ?default:
?? ??? ??? ?break;
?? ??? ?}
?? ?}
}

shape類主要是用來存儲畫過的圖形而定義的類型,將圖形存儲在shape類型的數(shù)組中就不會出現(xiàn)所畫的圖形消失的情況了。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Java手寫一個日志框架的示例代碼

    Java手寫一個日志框架的示例代碼

    日志框架是一種用于記錄和管理應(yīng)用程序運(yùn)行時信息的軟件組件,它通常提供了一套API讓開發(fā)人員能夠在代碼中插入日志語句,下面我們就來學(xué)習(xí)一下如何手寫一個日志框架吧
    2023-12-12
  • SpringBoot基于Redis的分布式鎖實(shí)現(xiàn)過程記錄

    SpringBoot基于Redis的分布式鎖實(shí)現(xiàn)過程記錄

    Redis是一套 key-value 高性能數(shù)據(jù)庫,使用它可以大大提高我們的開發(fā)效率,在SpringBoot中,自動配置也幫我們節(jié)約了大量的配置,下面這篇文章主要給大家介紹了關(guān)于SpringBoot基于Redis的分布式鎖實(shí)現(xiàn)的相關(guān)資料,需要的朋友可以參考下
    2022-01-01
  • 簡單了解java數(shù)組傳遞方法

    簡單了解java數(shù)組傳遞方法

    這篇文章主要介紹了簡單了解java數(shù)組傳遞方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-10-10
  • idea 自動生成類注釋和方法注釋的實(shí)現(xiàn)步驟

    idea 自動生成類注釋和方法注釋的實(shí)現(xiàn)步驟

    這篇文章主要介紹了idea 自動生成類注釋和方法注釋的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12
  • @RequestMapping 如何使用@PathVariable 從URI中獲取參數(shù)

    @RequestMapping 如何使用@PathVariable 從URI中獲取參數(shù)

    這篇文章主要介紹了@RequestMapping 如何使用@PathVariable 從URI中獲取參數(shù)的操作,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2021-08-08
  • Spring概述和快速構(gòu)建的方式

    Spring概述和快速構(gòu)建的方式

    Spring是一個輕量級的控制反轉(zhuǎn)(IoC)和面向切面(AOP)的容器(框架),Spring使用基本的JavaBean來完成以前只可能由EJB完成的事情,本文給大家介紹spring概述和快速構(gòu)建方式,一起看看吧
    2021-06-06
  • Java Swing實(shí)現(xiàn)窗體添加背景圖片的2種方法詳解

    Java Swing實(shí)現(xiàn)窗體添加背景圖片的2種方法詳解

    這篇文章主要介紹了Java Swing實(shí)現(xiàn)窗體添加背景圖片的2種方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了Swing實(shí)現(xiàn)窗體添加背景圖片的方法,并總結(jié)分析了Swing重繪中repaint與updateUI的區(qū)別,需要的朋友可以參考下
    2017-11-11
  • java根據(jù)負(fù)載自動抓取jstack?dump詳情

    java根據(jù)負(fù)載自動抓取jstack?dump詳情

    這篇文章主要介紹了java根據(jù)負(fù)載自動抓取jstack?dump詳情,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下
    2022-09-09
  • 基于Java實(shí)現(xiàn)考試管理系統(tǒng)

    基于Java實(shí)現(xiàn)考試管理系統(tǒng)

    這篇文章主要介紹了基于Java實(shí)現(xiàn)的考試管理系統(tǒng),項目運(yùn)用到的技術(shù)有Springboot、Maven、Jpa、Vue等等,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2021-12-12
  • 新版SpringSecurity安全配置說明

    新版SpringSecurity安全配置說明

    這篇文章主要介紹了新版SpringSecurity安全配置說明,在 Spring Security 5.7.0-M2 中,我們棄用了WebSecurityConfigurerAdapter,因為我們鼓勵用戶轉(zhuǎn)向基于組件的安全配置,需要的朋友可以參考下
    2023-07-07

最新評論