真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

JAVA進(jìn)程界面實(shí)驗(yàn)代碼 java進(jìn)程的幾種狀態(tài)

用java實(shí)現(xiàn)進(jìn)程創(chuàng)建與撤消

用JAVA,新建個(gè)類就好了。。。。按照面向?qū)ο蟮膶?shí)現(xiàn),然后用線程當(dāng)進(jìn)程去用就好。。。好像JAVA不能直接新建進(jìn)程,只能建線程。。。或者你弄成一個(gè)進(jìn)程數(shù)組,然后再去弄就好了。。。全部代碼的話,估計(jì)有也不會(huì)貼上來吧。。。寫這玩意有點(diǎn)那啥。。。

創(chuàng)新互聯(lián)是一家集網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站、網(wǎng)站頁面設(shè)計(jì)、網(wǎng)站優(yōu)化SEO優(yōu)化為一體的專業(yè)網(wǎng)站建設(shè)公司,已為成都等多地近百家企業(yè)提供網(wǎng)站建設(shè)服務(wù)。追求良好的瀏覽體驗(yàn),以探求精品塑造與理念升華,設(shè)計(jì)最適合用戶的網(wǎng)站頁面。 合作只是第一步,服務(wù)才是根本,我們始終堅(jiān)持講誠信,負(fù)責(zé)任的原則,為您進(jìn)行細(xì)心、貼心、認(rèn)真的服務(wù),與眾多客戶在蓬勃發(fā)展的市場環(huán)境中,互促共生。

請(qǐng)高手幫忙解決一個(gè)JAVA實(shí)驗(yàn)程序!!

我把你的第一個(gè)給你貼上來吧,第二個(gè)應(yīng)該也很簡單,不過我懶得麻煩,而且你那個(gè)什么試驗(yàn)五我也不清楚,代碼如下:

interface A{

public int method1(int x);

public int method2(int x,int y);

}

class B implements A{

public int method1(int x) {

// TODO Auto-generated method stub

int n = 1;

for(;x0;x--)

n=n*5;

return n;

}

public int method2(int x, int y) {

// TODO Auto-generated method stub

if(xy)

return y;

else return x;

}

}

public class test{

public static void main(String[] args){

B b=new B();

System.out.println(b.method1(2));

System.out.println(b.method2(2,8));

}

}

我全部都放到一起了,還有如果什么別的你不喜歡的地方,你自己改改,拿分走人。。。。

求一個(gè)簡單java程序代碼,謝謝

public class TestStar {

public static void main(String[] args) {

String star = "*";

for (int i = 0; i 5; i++) {

if (i == 0) {

System.out.print(" " + star);

System.out.println();

}

if (i == 1) {

for (int z = 0; z 4; z++) {

System.out.print(" " + star);

}

System.out.println();

}

if (i == 2) {

System.out.print(" ");

for (int x = 0; x 3; x++) {

System.out.print(" " + star);

}

System.out.println();

}

if (i == 3) {

for (int y = 0; y 2; y++) {

System.out.print(" " + star + " ");

}

}

}

}

}

是好使的 但是我沒找到畫五角星有什么規(guī)律(五角星好象不是正規(guī)圖形吧?)如果還有什么要求的話 補(bǔ)充問題(如果是用*填充所有的東西 不包括 “ ”的話 我可以重新再給你寫一個(gè))

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();//跟蹤文本和圖片寫到該區(qū)域的位置*************************************

scrollPane = new JScrollPane(text);

//注意下面對(duì)JComboBox的巧用***********************************************************************

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

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

String[] str_Style = { "常規(guī)", "斜體", "粗體", "粗斜體" };

String[] str_Color = { "黑色", "紅色", "藍(lán)色", "黃色", "綠色" };

String[] str_BackColor = { "無色", "灰色", "淡紅", "淡藍(lán)", "淡黃", "淡綠" };

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();//創(chuàng)建一個(gè)可以容納多個(gè)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("字號(hào)~~"),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); //設(shè)置文本區(qū)的換行策略。88888*********************************

send = new JButton("發(fā)送");

record=new JButton("顯示記錄");

saveRecord=new JButton("儲(chǔ)存記錄");

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));//設(shè)置按鈕間距*************************888

box_3.add(record); box_3.add(Box.createHorizontalStrut(8)); //設(shè)置按鈕間距*************************888

box_3.add(saveRecord); box_3.add(Box.createHorizontalStrut(8));//設(shè)置按鈕間距*************************888

box_3.add(image);

box.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),5));//設(shè)置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));//設(shè)置輸入窗口邊框線*******************

text.setBorder(BorderFactory.createLineBorder(new Color(102,102,0),8));//設(shè)置輸入窗口邊框線*******************

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));//設(shè)置輸入窗口邊框線*******************

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("常規(guī)")) {

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("藍(lán)色")) {

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("淡藍(lán)")) {

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;

}

}


分享標(biāo)題:JAVA進(jìn)程界面實(shí)驗(yàn)代碼 java進(jìn)程的幾種狀態(tài)
URL標(biāo)題:http://weahome.cn/article/ddedosj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部