微信小程序的源代码有哪几家

微信小程序的源代码有哪几家,第1张

售卖小程序源代码的公司有很多,但是一般不建议购买小程序源代码。首先一点是别人写的代码,自己再看的时候非常吃力,因为每个人写代码的逻辑思维都不一样;另外一点是如果有BUG,排查出来很麻烦,浪费时间和精力。建议还是可以直接用小程序模版制作,只需要更改内容就行。

也不知道你具体需求是什么,以前改过一个日历程序,一共四个java类,放在同一个包里。经测试可以运行。

//Startjava

import javaawt;

import javaxswing;

class Start{

public static void main(String [] args){

DateFrame frame=new DateFrame();

framesetLocationRelativeTo(frame);

framesetResizable(false);

framesetDefaultCloseOperation(JFrameEXIT_ON_CLOSE);

framesetVisible(true);

}

}

//DateInfojava

import javautil;

public class DateInfo{

private int mYear, mMonth;

private int mDayOfMonth, mFristWeek;

public DateInfo(int year, int month) throws DateException{

mYear = year;

if (month < 0 || month > 12){

throw (new DateException());

}

mMonth = month;

mDayOfMonth = getDayOfMonth(mYear, mMonth);

mFristWeek = getFristWeek(mYear, mMonth);

}

private int getDayOfMonth(int year, int month){

int[][] ary = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},

{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};

return (ary[isLeapYear(year)][month]);

}

private int isLeapYear(int year){

if (year % 4 == 0 && year % 100 != 0 ||year % 400 == 0){

return (1);

}

else{

return (0);

}

}

private int getFristWeek(int year, int month){

javautilCalendar cal = CalendargetInstance();

calset(year, month - 1, 1);

return (calget(CalendarDAY_OF_WEEK) - 1);

}

public String toString(){

String str;

str = "\t\t" + mYear + "年" + mMonth + "月\n";

str += "日\t一\t二\t三\t四\t五\t六\n";

int i;

for (i = 1; i <= mFristWeek; i++){

str += " \t";

}

for (int j = 1; j <= mDayOfMonth; j++, i++){

str +=j+"\t" ;

if (i % 7 == 0){

str += "\n";

}

}

return (str);

}

}

//DateFramejava

import javaawt;

import javaawtevent;

import javaxswing;

import javautilCalendar;

class DateFrame extends JFrame implements Runnable{

Calendar date=CalendargetInstance();

String[] str={"1","2","3","4","5","6","7","8","9","10","11","12"};

JLabel lblYear=new JLabel("年 ");

JLabel lblMonth=new JLabel("月 ");

JLabel lblDate=new JLabel("现在的时间是:");

JLabel lblShowDate=new JLabel();

// javaxswingJTextField trxt =new JTextField(10);

// trxtsetHorizontalAlignment(JTextFieldRIGHT); //设置文本从右边输入

JComboBox cboMonth=new JComboBox(str);

JComboBox cboYear=new JComboBox();

JTextArea txaShow=new JTextArea();

JPanel pnlNorth=new JPanel();

JPanel pnlSOUTH=new JPanel();

JButton btnShow=new JButton("显示");

JButton btnClose=new JButton("关闭");

JScrollPane jsp=new JScrollPane(txaShow);

Container c=thisgetContentPane();

public DateFrame(){

Thread thread=new Thread(this);

threadstart();

thissetTitle("玩玩日历拉!!!");

thissetSize(300,260);

for (int i = 1990; i<=2025; i++) {

cboYearaddItem(""+i);

}

cboYearsetSelectedItem(""+(dateget(CalendarYEAR)));

cboMonthsetSelectedItem(""+(dateget(CalendarMONTH)+1));

pnlNorthadd(cboYear);

txaShowsetTabSize(4); //设置tab键的距离

txaShowsetForeground(ColorGREEN);

pnlNorthadd(lblYear);

pnlNorthadd(cboMonth);

pnlNorthadd(lblMonth);

pnlNorthadd(lblDate);

pnlNorthadd(lblShowDate);

cadd(pnlNorth,BorderLayoutNORTH);

cadd(jsp);

pnlSOUTHadd(btnShow);

pnlSOUTHadd(btnClose);

cadd(pnlSOUTH,BorderLayoutSOUTH);

btnShowaddActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){

int year=IntegerparseInt((String)cboYeargetSelectedItem());

int month=IntegerparseInt((String)cboMonthgetSelectedItem());

try {

DateInfo date=new DateInfo(year,month);

txaShowsetText(""+date);

}

catch (DateException ex) {

exprintStackTrace();

}

}

});

btnCloseaddActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e){

Systemexit(0);

}

});

}

public void run(){

try {

while(true){

Threadsleep(1000);

int hour=dateget(CalendarHOUR);

int minute=dateget(CalendarMINUTE);

int second=dateget(CalendarSECOND);

String str=hour+":"+minute+":"+second;

lblShowDatesetText(str);

//thisrepaint();

}

}

catch (Exception ex) {

exprintStackTrace();

}

}

}

//DateExceptionjava

public class DateException extends Exception{

public DateException(){

super("日期数据不合法");

}

}

以上就是关于微信小程序的源代码有哪几家全部的内容,包括:微信小程序的源代码有哪几家、求Java 日历的小程序的源代码、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9402286.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-28
下一篇 2023-04-28

发表评论

登录后才能评论

评论列表(0条)

保存