⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 welcome.java

📁 一款少见的用swt写的彩票软件
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red05.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red06.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red07.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red08.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red09.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red10.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red11.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red12.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red13.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red14.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red15.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red16.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red17.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red18.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red19.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red20.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red21.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red22.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red23.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red24.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red25.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red26.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red27.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red28.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red29.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red30.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red31.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red32.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				red33.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
			}
		});
		clear_select_red.setText("清除");
		clear_select_red.setBounds(176, 90, 44, 18);

 		final Label show_red = new Label(group, SWT.NONE);
//		show_red.addPaintListener(new PaintListener() {
//			public void paintControl(PaintEvent e) {
//				for (int i = 0; i < 34; i++) {
//					if(red_store[i][1] == SELECTED){
//						red_temp_data.append(red_store[i][0]);
//					}
//				}
//			}
//		});
		if(red_temp_data == null){
			show_red.setText("");
		}else{
			show_red.setText(red_temp_data.toString());
		}
		show_red.setBounds(74, 65, 146, 18);
		/*
		 * GridData gridData = new GridData(GridData.FILL); gridData = new
		 * GridData(GridData.BEGINNING);
		 * 
		 * gridData.widthHint = 80; gridData.heightHint = 80;
		 * gridData.verticalSpan = 3; // canvas.setLayout(gridData);
		 */

		final Label label_2_1 = new Label(group, SWT.NONE);
		label_2_1.setBounds(10, 175, 58, 18);
		label_2_1.setText("蓝球选择:");

		final Label label_3_1 = new Label(group, SWT.NONE);
		label_3_1.setBounds(74, 175, 103, 18);
		label_3_1.setText("Label");

		final Button button_6 = new Button(group, SWT.NONE);
		button_6.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				
				//清除List缓存数据
				red_data_temp.clear();
				blue_data_temp.clear();
				
				System.out.println();
				int red_len = 33;
				int blue_len = 16;

				try {
					for (int i = 0; i < red_len; i++) {
						if (red_store[i][1] == SELECTED) {
							red_data_temp.add(red_store[i][0]);
							red_blue_data_temp.add(red_store[i][0]);
							
						}
					}
					for (int i = 0; i < blue_len; i++) {
						if (blue_store[i][1] == SELECTED) {
							blue_data_temp.add(blue_store[i][0]);
						}
					}
					int redlen = red_data_temp.size();
					int bluelen= blue_data_temp.size();
					int red_blue_len = redlen + 1;
					int red_temp[] = new int[redlen];
					int blue_temp[] = new int[bluelen];
					//int red_blue_temp[] = new int[red_blue_len];
					
					System.out.print("已选红球:");
					for (int i = 0; i < red_data_temp.size(); i++) {
						red_temp[i] = red_data_temp.get(i);
						//red_blue_temp[i] = red_temp[i];
						System.out.print(red_temp[i]+",");
					}
					
					System.out.print("已选蓝球:");
					for (int i = 0; i < blue_data_temp.size(); i++) {
						blue_temp[i] = blue_data_temp.get(i);
						System.out.print(blue_temp[i]+",");
					}
					System.out.println();
					for (int i = 0; i < blue_data_temp.size(); i++) {
						int blue_temp_data = blue_data_temp.get(i);
						System.out.println("对已选红球数组进行组合:C("+red_blue_len+",7)");
						Combination red_intCombination=new Combination(redlen,6);
						while(red_intCombination.hasMore()){
							int[] index=red_intCombination.getNext();
							for(int j=0;j<redlen;j++){
								if(index[j]!=0){
									System.out.print(red_temp[index[j]*j]+" ");
								}
								if(j == redlen - 1){
									System.out.print(blue_temp_data+" ");
								}
							}
							System.out.println();
						}
						
					}
					System.out.println();
				} catch (Exception exp) {
					exp.printStackTrace();
				}

			}

		});
		button_6.setText("投注");
		button_6.setBounds(176, 249, 44, 23);

		final Label label_1_1_1_1 = new Label(group, SWT.HORIZONTAL
				| SWT.SEPARATOR);
		label_1_1_1_1.setBounds(10, 278, 210, 11);
		label_1_1_1_1.setText("Label");

		final Label label_2_1_1 = new Label(group, SWT.NONE);
		label_2_1_1.setBounds(10, 331, 58, 18);
		label_2_1_1.setText("随机选择:");

		shownum0 = new Text(group, SWT.BORDER);
		shownum0.setBounds(10, 374, 25, 18);
		shownum0.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum0.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum1 = new Text(group, SWT.BORDER);
		shownum1.setBounds(41, 374, 25, 18);
		shownum1.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum1.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum2 = new Text(group, SWT.BORDER);
		shownum2.setBounds(74, 374, 25, 18);
		shownum2.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum2.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum3 = new Text(group, SWT.BORDER);
		shownum3.setBounds(105, 374, 25, 18);
		shownum3.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum3.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum4 = new Text(group, SWT.BORDER);
		shownum4.setBounds(136, 374, 25, 18);
		shownum4.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum4.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum5 = new Text(group, SWT.BORDER);
		shownum5.setBounds(167, 374, 25, 18);
		shownum5.setForeground(SWTResourceManager.getColor(255, 0, 0));
		shownum5.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		shownum6 = new Text(group, SWT.BORDER);
		shownum6.setBounds(10, 417, 25, 18);
		shownum6.setForeground(SWTResourceManager.getColor(0, 0, 255));
		shownum6.setFont(SWTResourceManager.getFont("", 8, SWT.NONE));

		final Label label_4 = new Label(group, SWT.NONE);
		label_4.setText("红球:");
		label_4.setBounds(10, 355, 25, 13);

		final Label label_5 = new Label(group, SWT.NONE);
		label_5.setText("蓝球");
		label_5.setBounds(10, 398, 25, 13);

		final Button start = new Button(group, SWT.NONE);
		start.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {

				Getrandom getrandom = new Getrandom();
				int red_data[] = new int[6];
				String[] red_str = new String[] { "0", "0", "0", "0", "0", "0",
				"0" };
				String blue_str = null;
				red_data = getrandom.GetRedRandomData();
				for (int i = 0; i < 6; i++) {
					if (red_data[i] / 10 == 0) {
						red_str[i] = "0" + String.valueOf(red_data[i]);
					} else {
						red_str[i] = String.valueOf(red_data[i]);
					}
					System.out.print(red_data[i] + "|");
				}
				System.out.println();

				int blue_data = getrandom.GetBlueRandomData();
				if (blue_data / 10 == 0) {
					blue_str = "0" + String.valueOf(blue_data);
				} else {
					blue_str = String.valueOf(blue_data);
				}
				shownum0.setText(red_str[0]);
				shownum1.setText(red_str[1]);
				shownum2.setText(red_str[2]);
				shownum3.setText(red_str[3]);
				shownum4.setText(red_str[4]);
				shownum5.setText(red_str[5]);
				shownum6.setText(blue_str);

			}
		});
		start.setBounds(41, 429, 58, 23);
		start.setText("随机生成");

		final Button button_6_1 = new Button(group, SWT.NONE);
		button_6_1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				if (shownum0.getText().length() == 0
						|| shownum1.getText().length() == 0
						|| shownum2.getText().length() == 0
						|| shownum3.getText().length() == 0
						|| shownum4.getText().length() == 0
						|| shownum5.getText().length() == 0
						|| shownum6.getText().length() == 0) {
					MessageBoxShow msg = new MessageBoxShow("请选择随机投注!", "提示");
					msg.start();
				} else {
					SaveToDatabase savetodatabase = new SaveToDatabase();
					try {
						savetodatabase.SaveSelection(shownum0.getText()
								.toString(), shownum1.getText().toString(),
								shownum2.getText().toString(), shownum3
								.getText().toString(), shownum4
								.getText().toString(), shownum5
								.getText().toString(), shownum6
								.getText().toString());
					} catch (Exception exp) {
						exp.printStackTrace();
					}

				}

			}
		});
		button_6_1.setBounds(176, 429, 44, 23);
		button_6_1.setText("投注");

		final Button button_2_1 = new Button(group, SWT.NONE);
		button_2_1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				shownum0.setText("");
				shownum1.setText("");
				shownum2.setText("");
				shownum3.setText("");
				shownum4.setText("");
				shownum5.setText("");
				shownum6.setText("");
			}
		});
		button_2_1.setBounds(117, 429, 44, 22);
		button_2_1.setText("清除");

		final Button button_2 = new Button(group, SWT.NONE);
		button_2.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				System.out.print("全选蓝球为:");
				for (int i = 0; i < 16; i++) {
					blue_store[i][1] = SELECTED;
					System.out.print(blue_store[i][0]+",");
				}
				System.out.println();
				blue01.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue02.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue03.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue04.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue05.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue06.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue07.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue08.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue09.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue10.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue11.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue12.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue13.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue14.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue15.setBackground(SWTResourceManager.getColor(0, 0, 255));
				blue16.setBackground(SWTResourceManager.getColor(0, 0, 255));
			}
		});
		button_2.setBounds(10, 191, 44, 18);
		button_2.setText("全选");

		final Button button_1_1 = new Button(group, SWT.NONE);
		button_1_1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				for (int i = 0; i < 16; i++) {
					blue_store[i][1] = UNSELECT;
				}
				blue01.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue02.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue03.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue04.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue05.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue06.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue07.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue08.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue09.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue10.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue11.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue12.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue13.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue14.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue15.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue16.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
			}
		});
		button_1_1.setBounds(93, 191, 44, 18);
		button_1_1.setText("反选");

		final Button clear_select_1 = new Button(group, SWT.NONE);
		clear_select_1.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				for (int i = 0; i < 16; i++) {
					blue_store[i][1] = UNSELECT;
				}
				blue01.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue02.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue03.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue04.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue05.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue06.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue07.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue08.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				blue09.setBackground(SWTResourceManager
						.getColor(SWT.COLOR_WIDGET_BACKGROUND));
				

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -