java Swing 时间选择器控件

2023-11-13

效果图:
这里写图片描述这里写图片描述这里写图片描述

简要说明:
一个视图类: HongYeLingGuDate
一个抽象接口: SelectHYDateAbstract
需要导入的jar包: http://download.csdn.net/detail/male09/9884835
这里写图片描述

中的 flowlayout_v.jar 文件

示例代码:

HongYeLingGuDate类

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
import javax.swing.border.EmptyBorder;

import com.changda.fingerservice.javaframe.VFlowLayout;

import hong.yelinggu.date.absinterface.SelectHYDateAbstract;

public class HongYeLingGuDate {

    private final JFrame frTime = new JFrame("请选择日期时间");

    private JPanel jPtimeWeek, jPtimeDay, year_form, ybJPanel, month_form, mbJPanel;

    private JButton btn_year_close, btn_month_close, btn_year_left, btn_year_right, btn_yes, btn_closed;

    private Box box;

    private JComboBox<String> jtf_H = null, jtf_m = null, jtf_s = null;

    private SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private List<JButton> btnList = new ArrayList<>();

    private JButton yearStart, monthEnd;

    private String SelectNow_day = "01";

    private int yearPage = 1;// 年份的页码

    private final int yearGAP = 5;// 首页的年差

    private final int PAGE_MAIN = 0;

    private final int PAGE_YEAR = 1;

    private final int PAGE_MONTH = 2;

    private Calendar instance = Calendar.getInstance();

    private int now_year = 0;

    private int now_month = 0;

    private int now_day = 0;

    private int now_hous = 0;

    private int now_min = 0;

    private int now_ss = 0;

    private SelectHYDateAbstract HdateInterface;

    String returnDateFormat = null;

    /**
     * 实例化控件
     * 
     * @param returnDateFormat
     *            返回的时间格式
     */
    public HongYeLingGuDate(String returnFormat) {
        // TODO Auto-generated constructor stub
        returnDateFormat = returnFormat;
    }

    /**
     * 创建时间拾取器
     */
    public void creatDatePicker(SelectHYDateAbstract dateInterface) {
        // TODO Auto-generated method stub

        //判断如果时间控件是显示可见的就不执行了,防止多次执行
        if (frTime.isVisible()){
            return;
        }
        HdateInterface = dateInterface;
        Date dateTime = new java.util.Date();
        String StringTime = sdFormat.format(dateTime);
        instance.setTime(dateTime);
        String[] splDate = StringTime.split(" ");
        String dateAssemble = splDate[0];
        String timeAssemble = splDate[1];
        String[] splitItemDate = dateAssemble.split("-");// 日期
        String[] splitItemTime = timeAssemble.split(":");// 时间
        now_year = Integer.parseInt(splitItemDate[0]);
        now_month = Integer.parseInt(splitItemDate[1]);
        now_day = Integer.parseInt(splitItemDate[2]);

        now_hous = Integer.parseInt(splitItemTime[0]);
        now_min = Integer.parseInt(splitItemTime[1]);
        now_ss = Integer.parseInt(splitItemTime[2]);

        frTime.getContentPane().setLayout(new VFlowLayout());

        // 年,月,日选择入口区
        JPanel jPtimeTiele = new JPanel(new GridLayout(1, 3));
        yearStart = new JButton(now_year + "年", new ImageIcon("./src/down.png"));
        monthEnd = new JButton((now_month < 10 ? "0" + now_month : now_month) + "月", new ImageIcon("./src/down.png"));
        yearStart.setFocusable(false);
        yearStart.setBorderPainted(false);
        yearStart.setBackground(new Color(0, 161, 203));
        monthEnd.setFocusable(false);
        monthEnd.setBorderPainted(false);
        monthEnd.setBackground(new Color(0, 161, 203));
        jPtimeTiele.add(yearStart);
        JButton btn_null = new JButton("");
        btn_null.setBorderPainted(false);
        btn_null.setBackground(new Color(245, 245, 245));
        btn_null.setFocusable(false);
        jPtimeTiele.add(btn_null);
        jPtimeTiele.add(monthEnd);
        jPtimeTiele.setBackground(new Color(0, 161, 203));

        // 周期 显示区
        jPtimeWeek = new JPanel(new GridLayout(1, 7));
        jPtimeWeek.setBorder(new EmptyBorder(8, 0, 8, 0));
        jPtimeWeek.setBackground(new Color(245, 245, 245));
        String[] weekText = { "周日", "周一", "周二", "周三", "周四", "周五", "周六" };

        for (int i = 0; i < weekText.length; i++) {
            jPtimeWeek.add(new JLabel(weekText[i], SwingConstants.CENTER));
        }
        jPtimeDay = new JPanel(new GridLayout(6, 7));
        jPtimeDay.setBackground(Color.WHITE);

        // 日期选择入口
        UpdataDateList(null);
        JPanel jPtimeTime = new JPanel(new FlowLayout(FlowLayout.LEFT));
        String[] hous = new String[24];
        for (int i = 0; i < hous.length; i++) {
            hous[i] = i < 10 ? "0" + i : String.valueOf(i);
        }
        jtf_H = new JComboBox<>(hous);
        jtf_H.setSelectedIndex(now_hous);
        jtf_H.setPreferredSize(new Dimension(50, 25));
        String[] mins = new String[60];
        String[] ss = new String[60];
        for (int i = 0; i < mins.length; i++) {
            mins[i] = i < 10 ? "0" + i : String.valueOf(i);
            ss[i] = i < 10 ? "0" + i : String.valueOf(i);
        }
        jtf_m = new JComboBox<>(mins);
        jtf_m.setSelectedIndex(now_min);
        jtf_m.setPreferredSize(new Dimension(50, 25));
        jtf_s = new JComboBox<>(ss);
        jtf_s.setSelectedIndex(now_ss);
        jtf_s.setPreferredSize(new Dimension(50, 25));
        jPtimeTime.add(new JLabel("时"));
        jPtimeTime.add(jtf_H);
        jPtimeTime.add(new JLabel("分"));
        jPtimeTime.add(jtf_m);
        jPtimeTime.add(new JLabel("秒"));
        jPtimeTime.add(jtf_s);
        box = Box.createHorizontalBox();
        box.add(jPtimeTime);
        JPanel panel_r = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        btn_closed = new JButton("关闭");
        btn_closed.setFocusable(false);
        btn_closed.setBorderPainted(false);
        btn_closed.setBackground(new Color(0, 161, 203));
        btn_yes = new JButton("确认");
        btn_yes.setBackground(new Color(0, 161, 203));
        btn_yes.setFocusable(false);
        btn_yes.setBorderPainted(false);
        panel_r.add(btn_closed);
        panel_r.add(btn_yes);
        box.add(panel_r);
        box.add(Box.createHorizontalGlue());
        box.add(panel_r);

        /*
         * 关闭时间选择器
         */
        btn_closed.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                frTime.dispose();
            }
        });

        /*
         * 确定选择的时间
         */
        btn_yes.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    // TODO Auto-generated method stub
                    StringBuffer sbfd = new StringBuffer();
                    sbfd.append(yearStart.getText()).append(monthEnd.getText()).append(SelectNow_day)
                            .append(jtf_H.getSelectedItem()).append(jtf_m.getSelectedItem())
                            .append(jtf_s.getSelectedItem());
                    String selectT = sbfd.toString().replace("年", "").replace("月", "");
                    if (HdateInterface != null) {
                        if (returnDateFormat != null) {
                            SimpleDateFormat nowFormat = new SimpleDateFormat("yyyyMMddHHmmss");
                            SimpleDateFormat format = new SimpleDateFormat(returnDateFormat);
                            Date parse = nowFormat.parse(selectT);
                            selectT = format.format(parse);
                        }
                        HdateInterface.clickOnSwingToTime(selectT);
                    }
                } catch (Exception e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
                frTime.dispose();
            }
        });

        frTime.add(jPtimeTiele);
        frTime.add(jPtimeWeek);
        frTime.add(jPtimeDay);
        frTime.add(box);

        /*
         * 年份的浮层
         */
        year_form = new JPanel(new GridLayout(5, 4));
        year_form.setBackground(Color.WHITE);
        final List<JButton> list_btn = new ArrayList<>();
        for (int i = now_year - yearGAP; i < now_year + 15; i++) {
            JButton btn_y = new JButton(i + "年");
            btn_y.setPreferredSize(new Dimension(45, 50));
            btn_y.setBackground(Color.WHITE);
            btn_y.setBorderPainted(false);
            btn_y.setFocusable(false);
            year_form.add(btn_y);
            list_btn.add(btn_y);
            btn_y.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO Auto-generated method stub
                    JButton ye = (JButton) e.getSource();
                    for (JButton jButton : list_btn) {
                        jButton.setBackground(Color.WHITE);
                    }
                    ye.setBackground(new Color(0, 161, 203));
                    selectYearClick(ye.getText().trim());
                }
            });
        }

        /*
         * 月份的浮层
         */
        month_form = new JPanel(new GridLayout(3, 4));
        month_form.setBackground(Color.WHITE);
        final List<JButton> list_month_btn = new ArrayList<>();
        for (int i = 1; i <= 12; i++) {
            JButton btn_y = new JButton((i < 10 ? "0" + i : i) + "月");
            btn_y.setPreferredSize(new Dimension(50, 80));
            btn_y.setBackground(Color.WHITE);
            btn_y.setBorderPainted(false);
            btn_y.setFocusable(false);
            month_form.add(btn_y);
            list_month_btn.add(btn_y);
            btn_y.addActionListener(new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO Auto-generated method stub
                    JButton ye = (JButton) e.getSource();
                    for (JButton jButton : list_month_btn) {
                        jButton.setBackground(Color.WHITE);
                    }
                    ye.setBackground(new Color(0, 161, 203));
                    monthEnd.setText(ye.getText().trim());
                    showhidle(PAGE_MAIN, true);
                }
            });
        }

        year_form.setVisible(false);
        month_form.setVisible(false);
        ybJPanel = new JPanel();
        mbJPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        btn_year_close = new JButton("关闭");
        btn_year_left = new JButton("上一页");
        btn_year_right = new JButton("下一页");
        btn_year_left.setPreferredSize(new Dimension(110, 30));
        btn_year_right.setPreferredSize(new Dimension(110, 30));
        btn_year_close.setPreferredSize(new Dimension(80, 30));

        btn_month_close = new JButton("关闭");
        ybJPanel.add(btn_year_left);
        ybJPanel.add(btn_year_right);
        JLabel jLabel_null = new JLabel("");
        jLabel_null.setPreferredSize(new Dimension(93, 22));
        ybJPanel.add(jLabel_null);
        ybJPanel.add(btn_year_close);
        mbJPanel.add(btn_month_close);
        ybJPanel.setVisible(false);
        mbJPanel.setVisible(false);
        frTime.add(year_form);
        frTime.add(month_form);

        frTime.add(ybJPanel);
        frTime.add(mbJPanel);

        frTime.pack();
        frTime.setSize(new Dimension(430, 370));
        frTime.setLocationRelativeTo(null);
        frTime.setResizable(false);
        frTime.setVisible(true);
        frTime.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);// 只关闭子窗口

        /*
         * 选择年份
         */
        yearStart.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                showhidle(PAGE_YEAR, true);
            }
        });

        /*
         * 年份上一页
         */
        btn_year_left.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent arg0) {
                // TODO Auto-generated method stub
                if (yearPage > 1) {
                    year_form.removeAll();
                    int startYest;
                    int nowGap = now_year - yearGAP;

                    startYest = nowGap + ((yearPage - 2) * 20);

                    final List<JButton> list_btn = new ArrayList<>();
                    for (int i = startYest; i < startYest + 20; i++) {
                        JButton btn_y = new JButton(i + "年");
                        btn_y.setPreferredSize(new Dimension(45, 50));
                        btn_y.setBackground(Color.WHITE);
                        btn_y.setBorderPainted(false);
                        btn_y.setFocusable(false);
                        year_form.add(btn_y);
                        list_btn.add(btn_y);
                        btn_y.addActionListener(new ActionListener() {

                            @Override
                            public void actionPerformed(ActionEvent e) {
                                // TODO Auto-generated method stub
                                JButton ye = (JButton) e.getSource();
                                for (JButton jButton : list_btn) {
                                    jButton.setBackground(Color.WHITE);
                                }
                                ye.setBackground(new Color(0, 161, 203));
                                selectYearClick(ye.getText().trim());
                            }
                        });
                        year_form.updateUI();
                    }
                    yearPage--;
                }
            }
        });

        /*
         * 年份下一页
         */
        btn_year_right.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub

                year_form.removeAll();
                int startYest;
                int nowGap = now_year - yearGAP;

                startYest = nowGap + (yearPage * 20);

                final List<JButton> list_btn = new ArrayList<>();
                for (int i = startYest; i < startYest + 20; i++) {
                    JButton btn_y = new JButton(i + "年");
                    btn_y.setPreferredSize(new Dimension(45, 50));
                    btn_y.setBackground(Color.WHITE);
                    btn_y.setBorderPainted(false);
                    btn_y.setFocusable(false);
                    year_form.add(btn_y);
                    list_btn.add(btn_y);
                    btn_y.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                            // TODO Auto-generated method stub
                            JButton ye = (JButton) e.getSource();
                            for (JButton jButton : list_btn) {
                                jButton.setBackground(Color.WHITE);
                            }
                            ye.setBackground(new Color(0, 161, 203));
                            selectYearClick(ye.getText().trim());
                        }
                    });
                    year_form.updateUI();
                }
                yearPage++;
            }
        });

        /*
         * 选择月份
         */
        monthEnd.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                showhidle(PAGE_MONTH, true);
            }
        });

        /**
         * 年份单个选择完毕
         */
        btn_year_close.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                showhidle(PAGE_MAIN, true);
            }
        });

        /**
         * 月份单个选择完毕
         */
        btn_month_close.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub
                showhidle(PAGE_MAIN, true);
            }
        });
    }

    /*
     *更新时间的天数
     * @param data
     *            时间格式: 年-月
     */
    private void UpdataDateList(String data) {
        try {
            if (data != null) {
                Date parse = sdFormat.parse(data);
                instance.setTime(parse);
                btnList.clear();
                jPtimeDay.removeAll();
            }
            instance.set(Calendar.DAY_OF_MONTH, 1);
            int week_mo = instance.get(Calendar.DAY_OF_WEEK);
            int maximum = instance.getActualMaximum(Calendar.DAY_OF_MONTH);
            for (int i = 1; i <= 42; i++) {
                String btnNum = "";
                int monthDay = 0;
                if (i >= week_mo && i < maximum + week_mo) {
                    monthDay = i - week_mo + 1;
                    btnNum = String.valueOf(monthDay < 10 ? "0" + monthDay : monthDay);
                }
                JButton btnDay = new JButton(btnNum);
                btnDay.setPreferredSize(new Dimension(30, 35));
                btnDay.setBorderPainted(false);
                if (now_day == monthDay) {
                    btnDay.setBackground(new Color(0, 161, 203));
                    btnDay.setForeground(Color.WHITE);
                    SelectNow_day = btnNum;
                } else {
                    btnDay.setBackground(Color.WHITE);
                }
                btnDay.setFocusable(false);
                btnDay.addActionListener(new ActionListener() {

                    @Override
                    public void actionPerformed(ActionEvent e) {
                        // TODO Auto-generated method stub
                        JButton source = (JButton) e.getSource();
                        SelectNow_day = source.getText().toString();
                        if (!source.getText().isEmpty()) {
                            for (JButton itembtn : btnList) {
                                itembtn.setBackground(Color.WHITE);
                                itembtn.setForeground(Color.BLACK);
                            }
                            source.setBackground(new Color(0, 161, 203));
                            source.setForeground(Color.WHITE);
                        }

                    }
                });
                btnList.add(btnDay);
                jPtimeDay.add(btnDay);
            }
            if (data != null) {
                jPtimeDay.updateUI();
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    /*
     * 选择的年份的事件
     */
    private void selectYearClick(String year) {
        yearStart.setText(year);
        showhidle(PAGE_MAIN, true);
    }

    /**
     * 显示隐藏切换
     * 
     * @param page
     *            页面
     * @param showpage
     *            是否显示
     */
    private void showhidle(int page, boolean showpage) {

        switch (page) {
        case PAGE_MAIN:// 主页

            jPtimeWeek.setVisible(showpage);
            jPtimeDay.setVisible(showpage);
            box.setVisible(showpage);

            year_form.setVisible(!showpage);
            ybJPanel.setVisible(!showpage);
            String yeatText = yearStart.getText().trim().replace("年", "");
            String monthText = monthEnd.getText().trim().replace("月", "");
            UpdataDateList(yeatText + "-" + monthText + "-01 00:00:00");
            break;
        case PAGE_YEAR:
            year_form.setVisible(showpage);
            ybJPanel.setVisible(showpage);

            jPtimeWeek.setVisible(!showpage);
            jPtimeDay.setVisible(!showpage);
            box.setVisible(!showpage);
            month_form.setVisible(!showpage);
            mbJPanel.setVisible(!showpage);

            break;
        case PAGE_MONTH:
            jPtimeWeek.setVisible(!showpage);
            jPtimeDay.setVisible(!showpage);
            box.setVisible(!showpage);
            year_form.setVisible(!showpage);
            ybJPanel.setVisible(!showpage);

            month_form.setVisible(showpage);
            mbJPanel.setVisible(showpage);
        default:
            break;
        }
    }
}

抽象类 : SelectHYDateAbstract
public abstract interface SelectHYDateAbstract {

/**
 * 选择的时间的回电方法
 * @param selectTime
 */

void clickOnSwingToTime(String selectTime);
}

类测试方法:

    //返回的数据格式
    private static String s = "yyyy-MM-dd HH:mm:ss";
    public static void main(String[] args) {
        HongYeLingGuDate guDate = new HongYeLingGuDate(s);
        guDate.creatDatePicker(new SelectHYDateAbstract() {

            @Override
            public void clickOnSwingToTime(String time) {
                // TODO Auto-generated method stub
                System.out.println("你选择的日期是="+time);
            }
        });
    }

选择后的测试结果:
你选择的日期是=2017-06-30 10:43:19

实用例子下载 : http://download.csdn.net/detail/male09/9884835

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

java Swing 时间选择器控件 的相关文章

随机推荐

  • DS静态查找之折半查找

    题目描述 给出一个队列和要查找的数值 找出数值在队列中的位置 队列位置从1开始 要求使用折半查找算法 输入 第一行输入n 表示队列有n个数据 第二行输入n个数据 都是正整数 用空格隔开 第三行输入t 表示有t个要查找的数值 第四行起 输入t
  • 抓包基本命令

    一 概述 在一个A应用程序内数据有不同的格式如 Integer String等 但是通过网络将数据传输给B应用程序 那么在到达B应用程序之前 数据都将统一解析成数据包 也就是二进制串在网络中传输 在B应用程序前布置一个 网 在这个数据包到达
  • Linux: USB Gadget 驱动简介

    文章目录 1 前言 2 背景 3 USB Gadget 驱动 3 1 什么是 USB Gadget 驱动 3 2 USB Gadget 驱动框架 3 3 USB 设备控制器 UDC 驱动 3 3 1 USB 设备控制器 UDC 驱动 概述
  • Eggjs 从放弃到开始使用

    原文 codesky me archives eg 用掘金刊登虽然分流了但是主要是 现在分享的曝光率实在太低了 所以 支持的请点下原博收藏下关注下以及我的微博 咦 这篇文章标题为什么反了 实际上这是个人走过的心路历程 最初看到 eggjs
  • FastDFS的Tracker及Storage节点添加及删除

    1 增加Storage节点 通过配置 自动加入 1 安装Storage并配置mod fastdfs conf及storage conf 设置fdfs storaged及nginx自启动 2 启动新加的storage节点 会自动同步相同gro
  • openGL之API学习(四)纹理操作

    纹理操作代码流程 向着色器传递纹理单元 glUniform1i gSampler 0 向GPU上传纹理数据 GLuint m textureObj glGenTextures 1 m textureObj 生成一个纹理对象 一个纹理对象有多
  • 谁会嫌钱多啊,最适合打工人小白的Python兼职攻略以及接私活经验!

    这次小编想谈谈一个非常热门的话题 就是如何在学习python的同时去赚钱 在这篇文章中 你会学习到如何通过学习python来赚取副业收入 相信大家都对钱感兴趣吧 如果你和马云爸爸对钱不敢兴趣的话 那这篇文章就不适合你了 如果你想知道如何使用
  • 计算机英语-基础知识

    计算机专业英语基础知识 1 专业英语的专业性和客观性 科技文章属于严肃的书面语体 崇尚严谨周密 逻辑性强 要求层次分明 重点突出 各个领域的专业英语都以表达科技概念 理论和事实为主要目的 因此 它们很注重客观事实和真相 要求逻辑性强 条理规
  • APISIX源码解析-插件-客户端IP【real-ip】

    real ip 客户端IP插件 关键属性 源码解析 real ip 插件用于动态改变传递到 APISIX 的客户端的 IP 和端口 local function get addr conf ctx if conf source http x
  • 卷运维不如卷网络安全

    最近发现很多从事运维的选择了辞职 重新规划自己的职业发展方向 运维工程师这个岗位在IT行业里面确实是处于最底层的 不管什么环节出现问题 基本都是运维背锅 背锅也就罢了 薪资水平也比不上别的岗位 一般运维的薪资水平大多数都是6 9K 还要高频
  • 【Rust】用RefCell避开`&mut XX`导致的借用检查

    derive Debug struct WhatAboutThis lt a gt name String nickname Option lt a str gt impl lt a gt WhatAboutThis lt a gt fn
  • 什么是本地储存?

    本地储存的作用 把一些数据记录在浏览器中 是浏览器提供给我们的一些本地存储数据的机制 localStorage 永久缓存 除非手动删除 sessionStorage 会话缓存 关闭浏览器就没有了 共同点 只能存储字符串格式的数据 local
  • 爬虫最快框架collyx,今天开源了...

    作者 TheWeiJun 工欲善其事 必先利其器 大家好 我是TheWeiJun 之前接触colly时 写过一篇关于colly框架的文章 由于当时能力有限加上时间不够充足 一直没能够去研究这个框架 后来经过3个多月的不断尝试完善 基于col
  • int类型数据相乘,溢出问题,负号变正号

    int相乘 不做强转的话 结果为int 溢出会出现结果不正确的情况 下面方法是个坑儿 如果要使用 需加强转 获取和日期间隔一定时间的时期 适合计算短时间间隔的情况 长时间间隔会出现溢出问题 影响正负号 方法待删除 param d1 para
  • UE4和C++ 开发-新手常用C++API

    C 暴露给蓝图可编辑 UCLASS Blueprintable 创建FString FString Printf TEXT aa bb 蓝图调用变量 UCLASS ClassGroup Custom meta BlueprintSpawna
  • Android使用Direct Textures提高glReadPixels、glTexImage2D性能

    from https www jianshu com p 1fa36461fc6f Android使用Direct Textures提高glReadPixels glTexImage2D性能 熊皮皮 关注 2017 02 05 15 52
  • weblogic双机(多机)集群搭建

    进去正题 1 创建集群 点击 锁定并编辑 选择 环境 gt 群集 gt 新建 gt 集群 填写 名称 选择 单点传送 点击 确定 集群创建完成 建议名称为 CLuster 项目名 一个项目配置一个集群环境 2 创建计算机 Machine 选
  • windows下的C++ socket服务器(1)

    windows下的C socket服务器 1 windows下的一个C socket服务器 用到了C 11的相关内容 现在还不是很完善 以后会不断改进的 include
  • 【已解决】android7.0以上使用charles抓HTTPS包报错certificate_unknown

    手机上是否有装证书都可以使用下面的方法 在你的AndroidManifest xml文件中添加如下配置
  • java Swing 时间选择器控件

    效果图 简要说明 一个视图类 HongYeLingGuDate 一个抽象接口 SelectHYDateAbstract 需要导入的jar包 http download csdn net detail male09 9884835 中的 fl