Frame的一些修饰看着一点都不爽!想请搞手指点下,怎么自定义标题栏背景,换掉放大,缩小,关闭按钮图标加上换掉Frame的边框!
如果有时间,请来点code 发贴不如QQ群聊得爽! TWaver SWING UI 群号:26532363 extending
如果有时间,请来点code 发贴不如QQ群聊得爽! TWaver SWING UI 群号:26532363 extending
解决方案 »
- java 里 有没有 用文件输入 代替 键盘输入的
- 关于Container中的add方法的疑问?
- 关于日期计算...
- 问一下Applet 加载第三方jar包问题? 高手们都进来看下咯
- 希望达人解惑--实际开发中java在桌面程序中的应用处于怎样的一个状态?
- 访问私有成员的问题,很简单
- 大家知道 java.net和 java.io包中的各个类分别用到什么设计模式? ( 60分 )
- 用java实现ping命令可否?直接写还是用其他语句 ,谢谢各位老大啦!挺着急的,呵呵
- JAVA中关键字和保留字是同一个感念吗
- JTable的问题(急,先谢大侠们)
- 谁能帮我解释一下这几个正则表达式是什么意思?
- 【JAVA】用bin.readLine()输入数据后用bw.write()写入文本后显示的却是ASCII码,怎么办?
具体点!JFrame的标题贴背景图片?怎么贴?全贴了我的事件按钮怎么办?自己绘,好想画! 可以来点code吗?
风格----指得是什么?皮肤?如果是皮肤好像有点改不了? 在线等高手指教!
LookAndFeel
可以用jdk1.6_10自带的vista玻璃效果,或更改皮肤啊。/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/package com.zrx.appviewer;
import java.awt.EventQueue;import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;import com.birosoft.liquid.LiquidLookAndFeel;public class LoginFrm extends JFrame { private JPasswordField passwordField;
private JTextField textField;
private static final long serialVersionUID = -6945936414733530893L; public static void main(String args[]) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
windowsLooks();
liquidLooks();
LoginFrm frame = new LoginFrm();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
} /**
* 利用Swing的LookAndFeel也可以实现时下流行的换肤功能 这里我们选用的第三方皮肤库为liquidlnf
* 这是一套比较好的皮肤,支持mac风格
*/
private void liquidLooks() throws ClassNotFoundException,
InstantiationException, IllegalAccessException,
UnsupportedLookAndFeelException {
UIManager
.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
// LiquidLookAndFeel.setLiquidDecorations(true);
LiquidLookAndFeel.setLiquidDecorations(true, "mac");
} /**
* 使用SWING自己代的皮肤中的WINDOWS中的皮肤 请在main函数中插入该段代码 (注意:要将其放置在窗口定义语句的前面)
* 如果观看该效果,请去掉该条语句的注释
*/
private void windowsLooks() throws ClassNotFoundException,
InstantiationException, IllegalAccessException,
UnsupportedLookAndFeelException {
javax.swing.UIManager
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
});
} /**
* Create the frame
*/
public LoginFrm() {
super();
getContentPane().setLayout(null);
setResizable(false);
setTitle("测试窗口");
setBounds(100, 100, 382, 258);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final JLabel username = new JLabel();
username.setText("用户名:");
username.setBounds(29, 47, 93, 25);
getContentPane().add(username); final JLabel pwd = new JLabel();
pwd.setText("口令:");
pwd.setBounds(29, 108, 93, 33);
getContentPane().add(pwd); textField = new JTextField();
textField.setBounds(128, 48, 205, 22);
getContentPane().add(textField); passwordField = new JPasswordField();
passwordField.setBounds(128, 113, 207, 22);
getContentPane().add(passwordField); final JButton button = new JButton();
button.setText("登陆");
button.setBounds(227, 168, 106, 28);
getContentPane().add(button); final JButton button_1 = new JButton();
button_1.setText("取消");
button_1.setBounds(28, 168, 106, 28);
getContentPane().add(button_1);
//
}}
不会每个都要自绘吧,应该绘一个都可以用吧?
譬如回了关闭按钮,JFrame ,JDialog 都可以用?
没绘过,想试试,哪位有经验说下