「java美化代码」java图形界面美化

博主:adminadmin 2023-01-19 09:39:09 383

本篇文章给大家谈谈java美化代码,以及java图形界面美化对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

java 窗口怎么美化

可以设置LookAndFeel,通过第三方皮肤:

可选使用substance、JTattoo、liquidlnf等,我当前使用的是JTattoo的皮肤,swing/awt的默认皮肤确实是有点那个...LZ可以去G一下上述皮肤,你会发现你的界面会很NICE的.

如下代码是我使用JTattoo的SmartLookAndFeel主题皮肤的方法,GoodLuck!

Java code?

public static void main(String[] args) {

JFrame.setDefaultLookAndFeelDecorated(true);

JDialog.setDefaultLookAndFeelDecorated(true);

try {

SmartLookAndFeel.setTheme("Green");

SmartLookAndFeel lookFeel = new SmartLookAndFeel();

javax.swing.UIManager.setLookAndFeel(lookFeel);

} catch (Exception e) {

e.printStackTrace();

}

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new ToolMainFrame().setVisible(true);

}

});

怎样美化JAVA界面?

使用Java的LookAndFeel设置,可以直接百度或Google一下,一般来说除非使用系统自带外观,否则需要下载jar包。

我比较推荐的是有Apple风格的QuaQuaLookAndFeel包,你可以查一下,下载后可直接放在工程中使用,很方便。

另外经常用到的较为权威的包是substance的外观优化,有很多如金属风格、复古风格等,

选择SWT/JFace吧,RCP插件式开发的效率也不是awt/Swing可以比的

java,eclipse美化代码格式的快捷键

Ctrl+shift+F 重新格式化代码....

还可以用菜单Source下format,多费1秒钟鼠标,

求JSP页面美化代码

%@ page language="java" import="java.util.*" pageEncoding="GB2312"%

html

body

h1教师信息管理/h1

h2a href="".教师基本信息维护./a/h2

h2a href="../iterate.do".试讲情况的管理./a/h2

h2a href="".合同信息记录./a/h2

/body

/html

%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%

%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

html

head

base href="%=basePath%"

titleMy JSP 'success.jsp' starting page/title

meta http-equiv="pragma" content="no-cache"

meta http-equiv="cache-control" content="no-cache"

meta http-equiv="expires" content="0"

meta http-equiv="keywords" content="keyword1,keyword2,keyword3"

meta http-equiv="description" content="This is my page"

!--

link rel="stylesheet" type="text/css" href="styles.css"

--/head

body

This is my JSP page. br

/body

/html%@ page language="java" import="java.util.*" pageEncoding="GB2312"%

html

body

h2.新增试讲教师信息./h2

form action="../add.do" method="post"

table

trtd姓名:input type="text" name="id"/td/tr

trtd授课名称:input type="text" name="sname"/td/tr

trtd分数:input type="text" name="score"/td/tr

trtd日期:input type="text" name="date"/td/tr

trtd联系方式:input type="text" name="contact"/td/tr

/table

input type="submit" value="提交"input type="reset" value="重置"

/form

/body

/html

谁知道java图形编程中皮肤美化的语句!!!!!

try {

// 更改皮肤

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

// UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

// UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");

} catch (ClassNotFoundException e) {

e.printStackTrace();

} catch (InstantiationException e) {

e.printStackTrace();

} catch (IllegalAccessException e) {

e.printStackTrace();

} catch (UnsupportedLookAndFeelException e) {

e.printStackTrace();

}

关于java美化代码和java图形界面美化的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。