请问Java如何动态显示当前内存占用率饼图

\u8bf7\u95eeC#\u5982\u4f55\u52a8\u6001\u663e\u793a\u5f53\u524d\u7269\u7406\u5185\u5b58\u5360\u7528\u7387\u997c\u56fe

.net\u7684GDI+\u5e93\u91cc\u9762\u5f88\u8f7b\u677e\u5c31\u80fd\u5b9e\u73b0\u56fe\u50cf\u7ed8\u5236\u7684\u8fd9\u4e2a\u9700\u6c42 \u4e3b\u8981\u7684\u547d\u540d\u7a7a\u95f4\u662fSystem.Drawing
0.5\u79d2\u5237\u65b0\u4e00\u6b21\u7684\u8bdd\u7528\u4e00\u4e2atimer\u63a7\u4ef6\u6765\u63a7\u5236 \u5728tick\u8fd9\u4e2a\u4e8b\u4ef6\u4e2d\u5199\u4f60\u7684\u5904\u7406\u8fc7\u7a0b
\u4e3b\u8981\u662f\u83b7\u53d6\u7269\u7406\u5185\u5b58\u548c\u5df2\u7ecf\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u8fd9\u4e24\u4e2a\u6570\u503c \u53ef\u4ee5\u901a\u8fc7kernel32\u8fd9\u4e2adll\u4e2d\u7684api\u83b7\u53d6\u3002

\u9996\u5148\uff1a\u5efa\u7acb\u4e00\u4e2a\u7ed3\u6784\u4f53 \u7528\u4e8e\u63a5\u6536api\u8fd4\u56de\u7684\u4fe1\u606f\uff08api\u91cc\u90a3\u4e2a\u65b9\u6cd5\u89c4\u5b9a\u7684\uff09
public struct MEMORY_INFO
{
public uint dwLength;
public uint dwMemoryLoad;
public uint dwTotalPhys;
public uint dwAvailPhys;
public uint dwTotalPageFile;
public uint dwAvailPageFile;
public uint dwTotalVirtual;
public uint dwAvailVirtual;
}

\u5176\u6b21\uff1a\u5efa\u7acb\u4e00\u4e2a\u5185\u5b58\u83b7\u53d6\u7c7b \u91cc\u9762\u8c03\u7528\u90a3\u4e2a\u65b9\u6cd5
public class getmemory
{
[DllImport("kernel32")]
public static extern void GlobalMemoryStatus(ref MEMORY_INFO meminfo);

}

\u6700\u540e\u67e5\u8be2\u65b9\u6cd5\uff1a
public void getmemory()
{
MEMORY_INFO MemInfo;
MemInfo = new MEMORY_INFO();
getmemory.GlobalMemoryStatus(ref MemInfo);

string MemoryLoad = MemInfo.dwMemoryLoad.ToString() + "%\u7684\u5185\u5b58\u6b63\u5728\u4f7f\u7528 ";
string TotalPhys = "\u7269\u7406\u5185\u5b58\u5171\u6709 " + MemInfo.dwTotalPhys.ToString() + "\u5b57\u8282 ";
string AvailPhys = "\u53ef\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u6709 " + MemInfo.dwAvailPhys.ToString() + "\u5b57\u8282 ";
string TotalPageFile = "\u4ea4\u6362\u6587\u4ef6\u603b\u5927\u5c0f\u4e3a " + MemInfo.dwTotalPageFile.ToString() + "\u5b57\u8282 ";
string AvailPageFile = "\u5c1a\u53ef\u4ea4\u6362\u6587\u4ef6\u5927\u5c0f\u4e3a " + MemInfo.dwAvailPageFile.ToString() + "\u5b57\u8282 ";
string TotalVirtual = "\u603b\u865a\u62df\u5185\u5b58\u6709 " + MemInfo.dwTotalVirtual.ToString() + "\u5b57\u8282 ";


}

\u8fd9\u4e2a\u9700\u6c42 \u4e3b\u8981\u7684\u547d\u540d\u7a7a\u95f4\u662fSystem.Drawing
0.5\u79d2\u5237\u65b0\u4e00\u6b21\u7684\u8bdd\u7528\u4e00\u4e2atimer\u63a7\u4ef6\u6765\u63a7\u5236 \u5728tick\u8fd9\u4e2a\u4e8b\u4ef6\u4e2d\u5199\u4f60\u7684\u5904\u7406\u8fc7\u7a0b
\u4e3b\u8981\u662f\u83b7\u53d6\u7269\u7406\u5185\u5b58\u548c\u5df2\u7ecf\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u8fd9\u4e24\u4e2a\u6570\u503c \u53ef\u4ee5\u901a\u8fc7kernel32\u8fd9\u4e2adll\u4e2d\u7684api\u83b7\u53d6\u3002

\u9996\u5148\uff1a\u5efa\u7acb\u4e00\u4e2a\u7ed3\u6784\u4f53 \u7528\u4e8e\u63a5\u6536api\u8fd4\u56de\u7684\u4fe1\u606f\uff08api\u91cc\u90a3\u4e2a\u65b9\u6cd5\u89c4\u5b9a\u7684\uff09
public struct MEMORY_INFO
{
public uint dwLength;
public uint dwMemoryLoad;
public uint dwTotalPhys;
public uint dwAvailPhys;
public uint dwTotalPageFile;
public uint dwAvailPageFile;
public uint dwTotalVirtual;
public uint dwAvailVirtual;
}

\u5176\u6b21\uff1a\u5efa\u7acb\u4e00\u4e2a\u5185\u5b58\u83b7\u53d6\u7c7b \u91cc\u9762\u8c03\u7528\u90a3\u4e2a\u65b9\u6cd5
public class getmemory
{
[DllImport("kernel32")]
public static extern void GlobalMemoryStatus(ref MEMORY_INFO meminfo);

}

\u6700\u540e\u67e5\u8be2\u65b9\u6cd5\uff1a
public void getmemory()
{
MEMORY_INFO MemInfo;
MemInfo = new MEMORY_INFO();
getmemory.GlobalMemoryStatus(ref MemInfo);

string MemoryLoad = MemInfo.dwMemoryLoad.ToString() + "%\u7684\u5185\u5b58\u6b63\u5728\u4f7f\u7528 ";
string TotalPhys = "\u7269\u7406\u5185\u5b58\u5171\u6709 " + MemInfo.dwTotalPhys.ToString() + "\u5b57\u8282 ";
string AvailPhys = "\u53ef\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u6709 " + MemInfo.dwAvailPhys.ToString() + "\u5b57\u8282 ";
string TotalPageFile = "\u4ea4\u6362\u6587\u4ef6\u603b\u5927\u5c0f\u4e3a " + MemInfo.dwTotalPageFile.ToString() + "\u5b57\u8282 ";
string AvailPageFile = "\u5c1a\u53ef\u4ea4\u6362\u6587\u4ef6\u5927\u5c0f\u4e3a " + MemInfo.dwAvailPageFile.ToString() + "\u5b57\u8282 ";
string TotalVirtual = "\u603b\u865a\u62df\u5185\u5b58\u6709 " + MemInfo.dwTotalVirtual.ToString() + "\u5b57\u8282 ";


}

这个东西不好找,想要你的分,找了一下午呢,下面的程序能读到内存使用情况,把读到的数据放在栈里,GUI的图饼类每隔0.5秒取栈里拿一次数据,然后刷新图饼就行了
JXM:Monitoring and Management Interface for the Java™ Platform

通过jmx可以监控vm内存使用,系统内存使用等

以下是网上某博客代码,特点是通过window和linux命令获得CPU使用率。

Java代码
利用java程序实现获取计算机cpu利用率和内存使用信息。

创建一个Bean用来存贮要得到的信

public class MonitorInfoBean {
/** 可使用内存. */
private long totalMemory;

/** 剩余内存. */
private long freeMemory;

/** 最大可使用内存. */
private long maxMemory;

/** 操作系统. */
private String osName;

/** 总的物理内存. */
private long totalMemorySize;

/** 剩余的物理内存. */
private long freePhysicalMemorySize;

/** 已使用的物理内存. */
private long usedMemory;

/** 线程总数. */
private int totalThread;

/** cpu使用率. */
private double cpuRatio;

public long getFreeMemory() {
return freeMemory;
}

public void setFreeMemory(long freeMemory) {
this.freeMemory = freeMemory;
}

public long getFreePhysicalMemorySize() {
return freePhysicalMemorySize;
}

public void setFreePhysicalMemorySize(long freePhysicalMemorySize) {
this.freePhysicalMemorySize = freePhysicalMemorySize;
}

public long getMaxMemory() {
return maxMemory;
}

public void setMaxMemory(long maxMemory) {
this.maxMemory = maxMemory;
}

public String getOsName() {
return osName;
}

public void setOsName(String osName) {
this.osName = osName;
}

public long getTotalMemory() {
return totalMemory;
}

public void setTotalMemory(long totalMemory) {
this.totalMemory = totalMemory;
}

public long getTotalMemorySize() {
return totalMemorySize;
}

public void setTotalMemorySize(long totalMemorySize) {
this.totalMemorySize = totalMemorySize;
}

public int getTotalThread() {
return totalThread;
}

public void setTotalThread(int totalThread) {
this.totalThread = totalThread;
}

public long getUsedMemory() {
return usedMemory;
}

public void setUsedMemory(long usedMemory) {
this.usedMemory = usedMemory;
}

public double getCpuRatio() {
return cpuRatio;
}

public void setCpuRatio(double cpuRatio) {
this.cpuRatio = cpuRatio;
}
}

之后,建立bean的接口

public interface IMonitorService {
public MonitorInfoBean getMonitorInfoBean() throws Exception;

}

然后,就是最关键的,得到cpu的利用率,已用内存,可用内存,最大内存等信息。

import java.io.InputStreamReader;
import java.io.LineNumberReader;

import sun.management.ManagementFactory;

import com.sun.management.OperatingSystemMXBean;
import java.io.*;
import java.util.StringTokenizer;

/**

* 获取系统信息的业务逻辑实现类.
* @author GuoHuang
*/
public class MonitorServiceImpl implements IMonitorService {

private static final int CPUTIME = 30;

private static final int PERCENT = 100;

private static final int FAULTLENGTH = 10;

private static final File versionFile = new File("/proc/version");
private static String linuxVersion = null;

/**
* 获得当前的监控对象.
* @return 返回构造好的监控对象
* @throws Exception
* @author GuoHuang
*/
public MonitorInfoBean getMonitorInfoBean() throws Exception {
int kb = 1024;

// 可使用内存
long totalMemory = Runtime.getRuntime().totalMemory() / kb;
// 剩余内存
long freeMemory = Runtime.getRuntime().freeMemory() / kb;
// 最大可使用内存
long maxMemory = Runtime.getRuntime().maxMemory() / kb;

OperatingSystemMXBean osmxb = (OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean();

// 操作系统
String osName = System.getProperty("os.name");
// 总的物理内存
long totalMemorySize = osmxb.getTotalPhysicalMemorySize() / kb;
// 剩余的物理内存
long freePhysicalMemorySize = osmxb.getFreePhysicalMemorySize() / kb;
// 已使用的物理内存
long usedMemory = (osmxb.getTotalPhysicalMemorySize() - osmxb
.getFreePhysicalMemorySize())
/ kb;

// 获得线程总数
ThreadGroup parentThread;
for (parentThread = Thread.currentThread().getThreadGroup(); parentThread
.getParent() != null; parentThread = parentThread.getParent())
;
int totalThread = parentThread.activeCount();

double cpuRatio = 0;
if (osName.toLowerCase().startsWith("windows")) {
cpuRatio = this.getCpuRatioForWindows();
}
else {
cpuRatio = this.getCpuRateForLinux();
}

// 构造返回对象
MonitorInfoBean infoBean = new MonitorInfoBean();
infoBean.setFreeMemory(freeMemory);
infoBean.setFreePhysicalMemorySize(freePhysicalMemorySize);
infoBean.setMaxMemory(maxMemory);
infoBean.setOsName(osName);
infoBean.setTotalMemory(totalMemory);
infoBean.setTotalMemorySize(totalMemorySize);
infoBean.setTotalThread(totalThread);
infoBean.setUsedMemory(usedMemory);
infoBean.setCpuRatio(cpuRatio);
return infoBean;
}
private static double getCpuRateForLinux(){
InputStream is = null;
InputStreamReader isr = null;
BufferedReader brStat = null;
StringTokenizer tokenStat = null;
try{
System.out.println("Get usage rate of CUP , linux version: "+linuxVersion);

Process process = Runtime.getRuntime().exec("top -b -n 1");
is = process.getInputStream();
isr = new InputStreamReader(is);
brStat = new BufferedReader(isr);

if(linuxVersion.equals("2.4")){
brStat.readLine();
brStat.readLine();
brStat.readLine();
brStat.readLine();

tokenStat = new StringTokenizer(brStat.readLine());
tokenStat.nextToken();
tokenStat.nextToken();
String user = tokenStat.nextToken();
tokenStat.nextToken();
String system = tokenStat.nextToken();
tokenStat.nextToken();
String nice = tokenStat.nextToken();

System.out.println(user+" , "+system+" , "+nice);

user = user.substring(0,user.indexOf("%"));
system = system.substring(0,system.indexOf("%"));
nice = nice.substring(0,nice.indexOf("%"));

float userUsage = new Float(user).floatValue();
float systemUsage = new Float(system).floatValue();
float niceUsage = new Float(nice).floatValue();

return (userUsage+systemUsage+niceUsage)/100;
}else{
brStat.readLine();
brStat.readLine();

tokenStat = new StringTokenizer(brStat.readLine());
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
String cpuUsage = tokenStat.nextToken();

System.out.println("CPU idle : "+cpuUsage);
Float usage = new Float(cpuUsage.substring(0,cpuUsage.indexOf("%")));

return (1-usage.floatValue()/100);
}

} catch(IOException ioe){
System.out.println(ioe.getMessage());
freeResource(is, isr, brStat);
return 1;
} finally{
freeResource(is, isr, brStat);
}

}
private static void freeResource(InputStream is, InputStreamReader isr, BufferedReader br){
try{
if(is!=null)
is.close();
if(isr!=null)
isr.close();
if(br!=null)
br.close();
}catch(IOException ioe){
System.out.println(ioe.getMessage());
}
}

/**
* 获得CPU使用率.
* @return 返回cpu使用率
* @author GuoHuang
*/
private double getCpuRatioForWindows() {
try {
String procCmd = System.getenv("windir")
+ "\\system32\\wbem\\wmic.exe process get Caption,CommandLine,"
+ "KernelModeTime,ReadOperationCount,ThreadCount,UserModeTime,WriteOperationCount";
// 取进程信息
long[] c0 = readCpu(Runtime.getRuntime().exec(procCmd));
Thread.sleep(CPUTIME);
long[] c1 = readCpu(Runtime.getRuntime().exec(procCmd));
if (c0 != null && c1 != null) {
long idletime = c1[0] - c0[0];
long busytime = c1[1] - c0[1];
return Double.valueOf(
PERCENT * (busytime) / (busytime + idletime))
.doubleValue();
} else {
return 0.0;
}
} catch (Exception ex) {
ex.printStackTrace();
return 0.0;
}
}

/**

* 读取CPU信息.
* @param proc
* @return
* @author GuoHuang
*/
private long[] readCpu(final Process proc) {
long[] retn = new long[2];
try {
proc.getOutputStream().close();
InputStreamReader ir = new InputStreamReader(proc.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line = input.readLine();
if (line == null || line.length() < FAULTLENGTH) {
return null;
}
int capidx = line.indexOf("Caption");
int cmdidx = line.indexOf("CommandLine");
int rocidx = line.indexOf("ReadOperationCount");
int umtidx = line.indexOf("UserModeTime");
int kmtidx = line.indexOf("KernelModeTime");
int wocidx = line.indexOf("WriteOperationCount");
long idletime = 0;
long kneltime = 0;
long usertime = 0;
while ((line = input.readLine()) != null) {
if (line.length() < wocidx) {
continue;
}
// 字段出现顺序:Caption,CommandLine,KernelModeTime,ReadOperationCount,
// ThreadCount,UserModeTime,WriteOperation
String caption = Bytes.substring(line, capidx, cmdidx - 1)
.trim();
String cmd = Bytes.substring(line, cmdidx, kmtidx - 1).trim();
if (cmd.indexOf("wmic.exe") >= 0) {
continue;
}
// log.info("line="+line);
if (caption.equals("System Idle Process")
|| caption.equals("System")) {
idletime += Long.valueOf(
Bytes.substring(line, kmtidx, rocidx - 1).trim())
.longValue();
idletime += Long.valueOf(
Bytes.substring(line, umtidx, wocidx - 1).trim())
.longValue();
continue;
}

kneltime += Long.valueOf(
Bytes.substring(line, kmtidx, rocidx - 1).trim())
.longValue();
usertime += Long.valueOf(
Bytes.substring(line, umtidx, wocidx - 1).trim())
.longValue();
}
retn[0] = idletime;
retn[1] = kneltime + usertime;
return retn;
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
proc.getInputStream().close();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}

/** 测试方法.
* @param args
* @throws Exception
* @author GuoHuang
*/
public static void main(String[] args) throws Exception {
IMonitorService service = new MonitorServiceImpl();
MonitorInfoBean monitorInfo = service.getMonitorInfoBean();
System.out.println("cpu占有率=" + monitorInfo.getCpuRatio());

System.out.println("可使用内存=" + monitorInfo.getTotalMemory());
System.out.println("剩余内存=" + monitorInfo.getFreeMemory());
System.out.println("最大可使用内存=" + monitorInfo.getMaxMemory());

System.out.println("操作系统=" + monitorInfo.getOsName());
System.out.println("总的物理内存=" + monitorInfo.getTotalMemorySize() + "kb");
System.out.println("剩余的物理内存=" + monitorInfo.getFreeMemory() + "kb");
System.out.println("已使用的物理内存=" + monitorInfo.getUsedMemory() + "kb");
System.out.println("线程总数=" + monitorInfo.getTotalThread() + "kb");
}
}

其中,Bytes类用来处理字符串

public class Bytes {
public static String substring(String src, int start_idx, int end_idx){
byte[] b = src.getBytes();
String tgt = "";
for(int i=start_idx; i<=end_idx; i++){
tgt +=(char)b[i];
}
return tgt;
}
}

Ctrl+Alt+Del 这三个键一起摁打开 Windows任务管理器 点下 性能 就能清楚的看出来内存使用和CPU使用。估计能帮到你吧

  • 鎬庝箞浣跨敤Java灏嗘椂闂鍔ㄦ鐨鏄剧ず鍦ㄧ綉椤典腑
    绛旓細鍚庢潵鍦≧ocky鐨勬彁閱掍笅鐢╯etTimeout()鎵嶈В鍐冲唴瀛樻硠婕忛棶棰榝unction nowTime(ev,type){ /* * ev:鏄剧ず鏃堕棿鐨勫厓绱 * type:鏃堕棿鏄剧ず妯″紡.鑻ヤ紶鍏12鍒欎负12灏忔椂鍒,涓嶄紶鍏ュ垯涓24灏忔椂鍒 */ //骞存湀鏃ユ椂鍒嗙 var Y,M,D,W,H,I,S; //鏈堟棩鏃跺垎绉掍负鍗曚綅鏃跺墠闈㈣ˉ闆 function fillZero(v){...
  • Java Jasperreport鍒朵綔涓涓ā鐗,鐢ㄤ簬鍔ㄦ佹樉绀涓浜涙暟鎹
    绛旓細鍦ㄦ彃鍏ラ噷闈㈡彃鍏ュ浘琛ㄥ氨鍙互浜嗭紝鐒跺悗浣跨敤鍚戝杩涜璁剧疆灏卞彲浠ヤ簡銆備笉杩噅asperreport鐨勫浘琛ㄥ姛鑳芥瘮杈冨皯锛岃屼笖鍋氬嚭鏉ョ殑鍥捐〃姣旇緝姝绘澘锛屾帹鑽愭ゼ涓绘垜鐜板湪鐢ㄧ殑鎶ヨ〃宸ュ叿锛宖inereport锛屾搷浣滃拰excel绫讳技鐨勶紝涓嶈繃瀹冨彲浠ュ仛寰堝婕備寒鐨勫浘琛紝闄や簡excel閭d簺甯歌鐨勫浘琛紝杩樿兘鍋氬弻杞村浘銆鍔ㄦ鍥俱佸湴鍩熷浘锛岃屼笖鑳藉仛鍒板姩鎬侀摼鎺ワ紝浣犺繖涓氨鍙互...
  • 濡備綍鐢JAVA缂栫▼鈥滃湪缃戦〉涓鏄剧ず鍔ㄦ鏃堕棿鈥
    绛旓細index.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> < String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";> <!DOCTYPE HTML PUBLIC "-//W3C//DTD ...
  • java 涓鐨勯偅涓狫list鎬庝箞鎵嶈兘鏄剧ず涓滆タ
    绛旓細鍏蜂綋浠g爜濡備笅:(鍒氬ソ鏄ㄥぉ鍥炵瓟鍒汉,鍐欑殑涓娈典唬鐮. 鍙互鍋氫釜绀鸿寖)鍏ㄩ儴鑿滃搧鐨凧List涓 ,鍗曞嚮鑿滃搧,鍙互鍑虹幇鍦ㄥ凡閫夎彍鍝佷腑 Jlist1(鍏ㄩ儴鑿滃搧)灏辨槸鐢ㄦ暟缁勭敓鎴愮殑Jlist JList2(宸查夎彍鍝)灏辨槸鍔ㄦ娣诲姞鏁版嵁鐨凧List import java.awt.*;import javax.swing.*;import javax.swing.event.*; public class MenuFrame...
  • 姹備竴涓JAVA椤甸潰,鍖呮嫭涓涓疄鏃剁殑鍔ㄦ佹樉绀鍟嗗搧鍗栫殑鏈澶氱殑5绉嶅晢鍝(姣忛殧10s...
    绛旓細鍓嶆椤甸潰鐢╦s瀹炵幇锛宻etTimeout涔嬬被鐨勫惊鐜嚱鏁帮紝姣10s涓娆jax鐨勮姹傦紝姣忔璇锋眰寰楀埌鐨勬暟鎹啀鐢╦s灏嗕箣鍓嶉瀹炴椂鏄剧ず鐨勫晢鍝佹浛鎹㈡帀
  • Java 姹傞棶濡備綍鎶鍔ㄦ鏁扮粍鍦ㄧ晫闈腑杈撳嚭,杩涜淇敼,鏄剧ず绛?
    绛旓細褰撶劧浣犲彲浠ヨ嚜宸遍氳繃鏁扮粍鐨勫鍒舵墿瀹圭瓑瀹炵幇涓涓彲鍙橀暱鐨勬暟缁勩傦紙浣嗗疄闄呬笂涔熶笉蹇呬簡锛屽洜涓烘湁浜咥rrayList锛java鐨闆嗗悎涓殑ArrayList绫伙紝浠庤嫳鏂囩被鍚嶆潵鐪嬪氨鐭ラ亾浜嗏滄暟缁勮〃鈥濄傚叾搴曞眰灏辨槸涓涓嚜鍔ㄦ墿瀹圭殑鏁扮粍銆備粠鑰屽疄鐜扮被浼尖鍔ㄦ鏁扮粍鈥濈殑鏁堟灉銆傚缓璁綘闃呰涓婣rrayList鐨勬簮鐮侊紝姣旇緝缁忓吀銆傛簮鐮佺墖娈 public ArrayList() {...
  • 濡備綍浠庝竴涓猨sp椤甸潰澶勭悊java绋嬪簭鍚鍔ㄦ鏀瑰彉鍘焜sp椤甸潰鑰岄殣钘忛儴鍒嗗唴瀹?姹 ...
    绛旓細棰樹富鐨勮姹傛病澶湅鎳傘傜幇鍦ㄩ〉闈笂鏈変袱涓猟iv锛岃闅愯棌鍏朵腑涓涓傛湁涓ょ鏂瑰紡锛氱敤js銆俲s鐨勫ソ澶勬槸涓嶇敤鍒锋柊椤甸潰锛屽彲浠ュ嵆鏃跺湴闅愯棌div鎴鏄剧ずdiv銆傜敤jsp銆傚鏋滈〉闈㈠埛鏂颁笉鍙伩鍏嶏紝鍒欏彲浠ュ湪jsp涓缃甦iv鐨勯殣钘忓睘鎬с傛墍浠ョ幇鍦ㄩ涓婚渶瑕佹槑纭紝浠涔堟椂鍊欒鍒锋柊椤甸潰骞堕殣钘忥紵浠涔堟椂鍊欎笉瑕佸埛鏂伴〉闈㈠苟闅愯棌锛熻繖鏍峰氨涓嶄細鍐茬獊浜嗐
  • java濡備綍鍒锋柊鍔ㄦ佹樉绀骞剁敓鎴 婊氬姩鏉
    绛旓細婊氬姩涓嶉毦锛 鍔ㄦ佹樉绀锛岀敤鐨勬槸Ajax 浣犲彲浠ュ幓浜嗚В涓
  • 缂栧啓JAVA绋嬪簭,鍦ㄥ叾涓湁涓涓寜閽拰涓涓枃鏈銆傚崟鍑绘寜閽椂,鏂囨湰妗嗕腑鏄...
    绛旓細鐢ㄦ潵鍔ㄦ琛ㄧず鏄剧ず鐨勮瘲鍙ャ5銆佺劧鍚庯紝鍦ㄧ綉椤典腑鎻掑叆涓涓寜閽6銆佹寜閽殑楂樺害涓33鍍忕礌锛屽搴︿负100鍍忕礌锛岀宸︿晶鍜屽彸渚х殑璺濈涓鸿嚜鍔紝绂婚《閮ㄧ殑璺濈涓20鍍忕礌銆7銆佺敤type灞炴э紝瀹氫箟鎸夐挳鐨勭被鍨嬩负button銆8銆佸畾涔夋寜閽殑鏍囩涓烘樉绀猴紝鍗曞嚮鍚庢墽琛岀殑鍑芥暟涓簊how銆9銆佹寜閽殑鑳屾櫙鑹插间负#aaeded锛屽瓧浣撳ぇ灏忎负20鍍忕礌銆
  • java楂樻墜璇疯繘;闂:濡備綍鐢╦ava浠g爜鑾峰彇浠绘剰涓寮犵綉椤典腑鏁版嵁(鍙兘鏄鍔ㄦ...
    绛旓細閭d簺鍦ㄩ〉闈笂鏄剧ず鐨勬暟鎹紝鍏跺疄骞朵笉鍦ㄩ〉闈紝鑰屾槸鍦ㄦ暟鎹簱閲屻傛暟鎹簱涓鑸湁涓狪D鍙峰瓧娈点傚彲浠ュ敮涓鏍囧織涓琛岃褰 鏄剧ず椤甸潰瀹為檯鏄釜鏌ヨ椤甸潰锛屾妸姣忎竴琛岃褰曢兘鏄剧ず鍑烘潵銆備緥濡備綘鍙互鍦ㄦ瘡涓琛岃褰曞姞涓涓垹闄ゆ寜閽傚皢杩欎釜鎸夐挳鍜岃繖琛岃褰曠殑ID鍙峰叧鑱旇捣鏉ワ紙杩欏綋鐒舵槸涓壒寰幆鐨勮繃绋嬶級<a href="abc.jsp?id=<%=rs.get...
  • 扩展阅读:java两种动态代理 ... java显示当前日期 ... java sort ... js动态显示当前时间 ... java反射与动态代理 ... java动态代理面试题 ... java入门 ... 显示时间的代码 ... 页面显示javascript打不开 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网