最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

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

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

一、介紹

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

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

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

public class draw extends JFrame{

?? ?private Shape shape[]= new Shape[100000];//將所畫的形狀存儲(chǔ)在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("矩形");//添加一個(gè)叫“矩形”的按鈕
?? ??? ?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);//在這個(gè)窗口上添加按鈕
?? ??? ?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};//提供四種顏色選擇,存儲(chǔ)在colors數(shù)組中
?? ??? ?for(int i=0;i<4;i++) {//新建4個(gè)顏色選擇的按鈕
?? ??? ??? ?JButton jButton=new JButton();
?? ??? ??? ?jButton.setBackground(colors[i]);
?? ??? ??? ?jButton.setPreferredSize(new Dimension(30, 30));
?? ??? ??? ?this.add(jButton);//在這個(gè)窗口上添加次按鈕
?? ??? ??? ?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新建一個(gè)drawlistener類。
在項(xiàng)目進(jìn)行的過程中,將窗口最小化或者改變窗口大小時(shí),我們先前畫的東西就全部消失了。這是因?yàn)楫?dāng)窗體在屏幕上顯示的時(shí)候,首先是將窗體對(duì)象的數(shù)據(jù)從內(nèi)存中取出來放到緩存中,再在屏幕上進(jìn)行繪制。當(dāng)窗體發(fā)生改變的時(shí)候,程序就會(huì)重新從內(nèi)存中獲取更新后的數(shù)據(jù)繪制。**在系統(tǒng)中Jframe的父類中提供有一個(gè)paint(Graphics g)的方法來負(fù)責(zé)將窗口數(shù)據(jù)在屏幕上繪制出來。**所以我重寫了paint(Graphics g)方法,先將畫過的圖形存儲(chǔ)在一個(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)釋放時(shí)畫橢圓
?? ??? ??? ?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)釋放時(shí)且不是最后一次畫時(shí)畫直線
? ? ? ? ?? ?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)) {//畫線主要是下一個(gè)點(diǎn)和上一個(gè)點(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類主要是用來存儲(chǔ)畫過的圖形而定義的類型,將圖形存儲(chǔ)在shape類型的數(shù)組中就不會(huì)出現(xiàn)所畫的圖形消失的情況了。

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

相關(guān)文章

  • win10設(shè)置java環(huán)境變量的方法

    win10設(shè)置java環(huán)境變量的方法

    下面小編就為大家?guī)硪黄獁in10設(shè)置java環(huán)境變量的方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-01-01
  • Spring整合Springmvc的相關(guān)介紹

    Spring整合Springmvc的相關(guān)介紹

    今天小編就為大家分享一篇關(guān)于Spring整合Springmvc的相關(guān)介紹,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-01-01
  • 如何在yml配置文件中使用中文注解

    如何在yml配置文件中使用中文注解

    這篇文章主要介紹了如何在yml配置文件中使用中文注解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-10-10
  • Java中使用注解校驗(yàn)手機(jī)號(hào)格式的詳細(xì)指南

    Java中使用注解校驗(yàn)手機(jī)號(hào)格式的詳細(xì)指南

    在現(xiàn)代的Web應(yīng)用開發(fā)中,數(shù)據(jù)校驗(yàn)是一個(gè)非常重要的環(huán)節(jié),本文將詳細(xì)介紹如何在Java中使用注解對(duì)手機(jī)號(hào)格式進(jìn)行校驗(yàn),感興趣的小伙伴可以了解下
    2025-03-03
  • 詳解Java文件下載的幾種實(shí)現(xiàn)方式

    詳解Java文件下載的幾種實(shí)現(xiàn)方式

    這篇文章主要介紹了詳解Java文件下載的幾種實(shí)現(xiàn)方式,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-12-12
  • PC 端微信掃碼注冊(cè)和登錄實(shí)例

    PC 端微信掃碼注冊(cè)和登錄實(shí)例

    這篇文章主要介紹了PC 端微信掃碼注冊(cè)和登錄實(shí)例的相關(guān)資料,需要的朋友可以參考下
    2016-09-09
  • Java 爬蟲數(shù)據(jù)異步加載如何解決

    Java 爬蟲數(shù)據(jù)異步加載如何解決

    這篇文章主要介紹了Java 爬蟲遇上數(shù)據(jù)異步加載,試試這兩種辦法!問題如何解決,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-10-10
  • SpringBoot程序加密保護(hù)代碼不被反編譯

    SpringBoot程序加密保護(hù)代碼不被反編譯

    在Java開發(fā)中,保護(hù)代碼不被反編譯是非常重要的,尤其是涉及核心業(yè)務(wù)邏輯或關(guān)鍵技術(shù)時(shí),常用的反編譯工具如 jadx 可以輕松將 Java 字節(jié)碼還原成可讀的源代碼,本文將介紹如何通過加密和混淆技術(shù),在SpringBoot程序中實(shí)現(xiàn)反編譯保護(hù)
    2024-12-12
  • Nett分布式分隔符解碼器邏輯源碼剖析

    Nett分布式分隔符解碼器邏輯源碼剖析

    這篇文章主要為大家介紹了Nett分布式分隔符解碼器邏輯源碼剖析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-03-03
  • ReentrantLock從源碼解析Java多線程同步學(xué)習(xí)

    ReentrantLock從源碼解析Java多線程同步學(xué)習(xí)

    這篇文章主要為大家介紹了ReentrantLock從源碼解析Java多線程同步學(xué)習(xí),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-04-04

最新評(píng)論

商洛市| 台中县| 高州市| 石泉县| 怀安县| 沈丘县| 邯郸市| 通榆县| 昌都县| 车险| 蒙阴县| 信阳市| 赞皇县| 景洪市| 盘山县| 娄烦县| 黔西| 弥勒县| 新巴尔虎左旗| 开平市| 建德市| 蓝田县| 松桃| 开封市| 辽中县| 贵港市| 酒泉市| 绩溪县| 赤壁市| 莆田市| 高雄县| 阿瓦提县| 赞皇县| 民和| 孟连| 英山县| 论坛| 安阳市| 盘山县| 宝山区| 观塘区|