网站建设资讯

NEWS

网站建设资讯

灰色预测java代码 灰色预测代码Python

idea java代码灰色 不是类名或者文件 是代码 运行正常 求解决办法 比如注解应该是黄色 现在是灰色

视图里面改一下就好了,反正就那么几个选项

我们提供的服务有:成都做网站、成都网站制作、微信公众号开发、网站优化、网站认证、吉利ssl等。为1000多家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的吉利网站制作公司

你都点一遍顺便还可以熟悉一下其他的功能,点了看看效果,不要怕麻烦,初学习阶段最好都尝试一遍,这样以后遇到问题的时候就能快速解决,特别是工作当中,裨益颇大

Matlab实现或者java编程实现 神经网络 灰色模型预测

灰色预测模型为GM(1,1)

灰参数a和u的值:

a=-0.0323252892223847 u=14042.3315313962

原始序列预测值:

13205 14705 15188 15687 16203 16735 17285 17853 18439 19045

累加序列预测值:

14705 15188 15687 16203 16735 17285 17853 18439 19045 19671

级比值:

0.933017734755882 0.991731483427931 0.906095238095238 0.951546640889319 0.951264367816092 0.952798160113898 0.980668027064762 0.994977559307544 1.07637451115712

相对误差值:

0 3.90438540431923 6.43063985387993 0.395441255218115 2.10782203579584 3.81930406598348 5.34849588953024 4.12878515843797 1.47641388551927 0.5323261370569

2013-2017年的预测值

2013 20317.4561851648

2014 20984.954243779

2015 21674.381900971

2016 22386.4596192006

2017 23121.9315305897

JAVA的图形用户界面代码

package hao;

import java.awt.BorderLayout;

import java.awt.Color;

import java.awt.Dimension;

import java.awt.GridLayout;

import java.io.File;

import javax.swing.BorderFactory;

import javax.swing.Box;

import javax.swing.ImageIcon;

import javax.swing.JButton;

import javax.swing.JComboBox;

import javax.swing.JLabel;

import javax.swing.JPanel;

import javax.swing.JScrollPane;

import javax.swing.JTextArea;

import javax.swing.JTextPane;

import javax.swing.text.BadLocationException;

import javax.swing.text.SimpleAttributeSet;

import javax.swing.text.StyleConstants;

import javax.swing.text.StyledDocument;

public class ChatPanel extends JPanel {

private static final long serialVersionUID = 1L;

JButton send,record,saveRecord,image;

JTextArea inputArea;

JTextPane text;//注意用法****************************************************************************

JComboBox fontName = null, fontSize = null, fontStyle = null, fontColor = null,fontBackColor = null;

public StyledDocument doc = null; JScrollPane scrollPane;JPanel textChat;

JButton music;

public ChatPanel() {

setLayout(new BorderLayout());

text = new JTextPane();

text.setEditable(false);

doc = text.getStyledDocument();//跟踪文本和图片写到该区域的位置*************************************

scrollPane = new JScrollPane(text);

//注意下面对JComboBox的巧用***********************************************************************

String[] str_name = { "宋体", "黑体", "Dialog", "Gulim" };

String[] str_Size = { "12", "14", "18", "22", "30", "40" };

String[] str_Style = { "常规", "斜体", "粗体", "粗斜体" };

String[] str_Color = { "黑色", "红色", "蓝色", "黄色", "绿色" };

String[] str_BackColor = { "无色", "灰色", "淡红", "淡蓝", "淡黄", "淡绿" };

fontName = new JComboBox(str_name);

fontSize = new JComboBox(str_Size);

fontStyle = new JComboBox(str_Style);

fontColor = new JComboBox(str_Color);

fontBackColor = new JComboBox(str_BackColor);

fontName.setBackground(new Color(255,153,255));

fontSize.setBackground(new Color(255,153,255));

fontStyle.setBackground(new Color(255,153,255));

fontColor.setBackground(new Color(255,153,255));

fontBackColor.setBackground(new Color(255,153,255));

Box box = Box.createVerticalBox();//创建一个可以容纳多个Box组件的Box*******************************

Box box_1 = Box.createHorizontalBox();

Box box_2 = Box.createHorizontalBox();

Box box_4 = Box.createHorizontalBox();

box.add(box_1);

box.add(box_2);

box.add(box_4);

JLabel b1= new JLabel("字体~~"), b2 = new JLabel("样式~~"),b3 = new JLabel("字号~~"),b4 = new JLabel("颜色~~"),b5 = new JLabel("背景~~");

b1.setBackground(new Color(255,153,255));

b2.setBackground(new Color(255,153,255));

b3.setBackground(new Color(255,153,255));

b4.setBackground(new Color(255,153,255));

b5.setBackground(new Color(255,153,255));

box_1.add(b1);

box_1.add(fontName);

box_1.add(Box.createHorizontalStrut(8));

box_1.add(b2);

box_1.add(fontStyle);

box_1.add(Box.createHorizontalStrut(8));

box_1.add(b3);

box_1.add(fontSize);

box_2.add(Box.createHorizontalStrut(8));

box_2.add(b4);

box_2.add(fontColor);

box_2.add(Box.createHorizontalStrut(8));

box_4.add(b5);

box_4.add(fontBackColor);

textChat = new JPanel();

textChat.setLayout(new BorderLayout());

textChat.setBackground(new Color(255,153,255));

inputArea = new JTextArea(3, 20);

inputArea.setLineWrap(true); //设置文本区的换行策略。88888*********************************

send = new JButton("发送");

record=new JButton("显示记录");

saveRecord=new JButton("储存记录");

image=new JButton("表情");

send.setBackground(new Color(255,153,255));

record.setBackground(new Color(255,153,255));

saveRecord.setBackground(new Color(255,153,255));

image.setBackground(new Color(255,153,255));

Box box_3 = Box.createHorizontalBox();

box_3.add(send); box_3.add(Box.createHorizontalStrut(8));//设置按钮间距*************************888

box_3.add(record); box_3.add(Box.createHorizontalStrut(8)); //设置按钮间距*************************888

box_3.add(saveRecord); box_3.add(Box.createHorizontalStrut(8));//设置按钮间距*************************888

box_3.add(image);

box.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));//设置Box的边框线********************

box_3.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));

textChat.add(box,BorderLayout.NORTH);

textChat.add(inputArea,BorderLayout.CENTER);

textChat.add(box_3, BorderLayout.SOUTH);

inputArea.requestFocus(true);

inputArea.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));//设置输入窗口边框线*******************

text.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),8));//设置输入窗口边框线*******************

JPanel audioPanel = new JPanel();//最上面的边框************************************************************************

audioPanel.setBackground(new Color(255,153,255));

audioPanel.setLayout(new GridLayout(1,1));

music = new JButton("想听就听");

music.setPreferredSize(new Dimension(320,50));

music.setBorder(BorderFactory.createLineBorder(Color.BLACK,10));//设置输入窗口边框线*******************

audioPanel.add(music);

add(audioPanel, BorderLayout.NORTH);

add(scrollPane,BorderLayout.CENTER);

add(textChat, BorderLayout.SOUTH);

}

void insertIcon(ImageIcon image) {

text.setCaretPosition(doc.getLength());

text.insertIcon(image);

insert(new MessageStyle());//?????????????????????????????????????????????????????????????????????????????/

}

public void insert(MessageStyle attrib) {

try {

doc.insertString(doc.getLength(), attrib.getText() + "\n", attrib.getAttrSet());//写完后接着换行************

} catch (BadLocationException e) {

e.printStackTrace();

}

}

public MessageStyle getMessageStyle(String line) {

MessageStyle att = new MessageStyle();

att.setText(line);

att.setName((String) fontName.getSelectedItem());

att.setSize(Integer.parseInt((String) fontSize.getSelectedItem()));

String temp_style = (String) fontStyle.getSelectedItem();

if (temp_style.equals("常规")) {

att.setStyle(MessageStyle.GENERAL);

}

else if (temp_style.equals("粗体")) {

att.setStyle(MessageStyle.BOLD);

}

else if (temp_style.equals("斜体")) {

att.setStyle(MessageStyle.ITALIC);

}

else if (temp_style.equals("粗斜体")) {

att.setStyle(MessageStyle.BOLD_ITALIC);

}

String temp_color = (String) fontColor.getSelectedItem();

if (temp_color.equals("黑色")) {

att.setColor(new Color(0, 0, 0));

}

else if (temp_color.equals("红色")) {

att.setColor(new Color(255, 0, 0));

}

else if (temp_color.equals("蓝色")) {

att.setColor(new Color(0, 0, 255));

}

else if (temp_color.equals("黄色")) {

att.setColor(new Color(255, 255, 0));

}

else if (temp_color.equals("绿色")) {

att.setColor(new Color(0, 255, 0));

}

String temp_backColor = (String) fontBackColor.getSelectedItem();

if (!temp_backColor.equals("无色")) {

if (temp_backColor.equals("灰色")) {

att.setBackColor(new Color(200, 200, 200));

}

else if (temp_backColor.equals("淡红")) {

att.setBackColor(new Color(255, 200, 200));

}

else if (temp_backColor.equals("淡蓝")) {

att.setBackColor(new Color(200, 200, 255));

}

else if (temp_backColor.equals("淡黄")) {

att.setBackColor(new Color(255, 255, 200));

}

else if (temp_backColor.equals("淡绿")) {

att.setBackColor(new Color(200, 255, 200));

}

}

return att;

}

}

java课程设计题目及代码是什么?

java课程设计题目及代码分别是:

1、题目:计算器。设计内容是设计一个图形界面(GUI)的计算器应用程序,完成简单的算术运算。

设计要求是设计的计算器应用程序可以完成家法、减法、乘法、除法和取余运算。且有小数点、正负号、求倒数、退格和清零功能。

2、代码:

数字按钮NumberButton类如下:

import java.awt.

import java.awt.event.

import javax.swing.

public class NumberButton extends Button.

{

int number.

public NumberButton(int number).

{

super(""+number).

this.number=number.

setForeground(Color.blue).

}

public int getNumber().

{

return number;

}

}

其它java课程设计题目及代码是:

题目:华容道。编写一个按钮的子类,使用该子类创建的对象代表华容道中的人物。通过焦点事件控制人物颜色,当人物获得焦点时颜色为蓝色,当失去焦点时颜色为灰色。

通过键盘事件和鼠标事件来实现曹操、关羽等人物的移动。当人物上发生鼠标事件或键盘事件时,如果鼠标指针的位置是在人物的下方(也就是组件的下半部分)或按下键盘的“↓“键,该人物向下移动。向左、向右和向上的移动原理类似。

代码是:

String name[]={"曹操","关羽","张","刘","马","许","兵","兵","兵","兵"}.

for(int i=0;iname.length;i++).

{

person[i]=new Person(i,name[i]).

person[i].addKeyListener(this).

person[i].addMouseListener(this).

//     person[i].addFocusListener(new Person).

add(person[i]).

}

person[0].setBounds(104,54,100,100).

person[1].setBounds(104,154,100,50).

person[2].setBounds(54,154,50,100).

person[3].setBounds(204,154,50,100).

person[4].setBounds(54,54,50,100).

person[5].setBounds(204,54,50,100);

person[6].setBounds(54,254,50,50);

person[7].setBounds(204,254,50,50);

person[8].setBounds(104,204,50,50);

person[9].setBounds(154,204,50,50);

Android Studio 编写java代码的时候,代码不同颜色是什么意思???? 求大神解答!!

黄色高亮的是系统中的关键字,白色是类名,灰色是普通变量。


网页标题:灰色预测java代码 灰色预测代码Python
标题网址:http://cdweb.net/article/hggssc.html