java swing 可以画一个透明的矩形吗?(或多边形) 找了找好像只有 fillRect...fillPolygon...之类的。。没发现透明 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 透明的不是图形,是Composite。 最新的jdk-6u10版本已经在进行beta测试,对于swing来说,在此版本中增加了两个重要的功能:透明窗体和不规则窗体。这两个功能使得swing也可以做出vista下的玻璃效果来了, jdk-6u10还没有正式发布,可以在http://download.java.net/jdk6/binaries/进行下载publicclassTranslucentWindowextendsJFrame{ publicTranslucentWindow(){ super("透明窗体"); this.setLayout(newFlowLayout()); this.add(newJButton("按钮")); this.add(newJCheckBox("复选按钮")); this.add(newJRadioButton("单选按钮")); this.add(newJProgressBar(20,100)); this.setSize(newDimension(400,300)); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } publicstaticvoidmain(String[]args){ JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(newRunnable(){ publicvoidrun(){ Windoww=newTranslucentWindow(); w.setVisible(true); com.sun.awt.AWTUtilities.setWindowOpacity(w,0.6f); } }); } }publicclassTranslucentWindowextendsJFrame{ publicTranslucentWindow(){ super("透明窗体"); this.setLayout(newFlowLayout()); this.add(newJButton("按钮")); this.add(newJCheckBox("复选按钮")); this.add(newJRadioButton("单选按钮")); this.add(newJProgressBar(20,100)); this.setSize(newDimension(400,300)); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } publicstaticvoidmain(String[]args){ JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(newRunnable(){ publicvoidrun(){ Windoww=newTranslucentWindow(); w.setVisible(true); com.sun.awt.AWTUtilities.setWindowOpacity(w,0.6f); } }); } }来自http://wenwen.soso.com/z/q131333431.htm drawRect/drawPolygon 绘制的图形只有边,算透明吗?使用带alpha分量的Color fill算透明不? JAVA开发的图形用户界面程序怎么命名规范? 简单Person出错求解 [向all提问]JAVA实现的吸血鬼数字算法,高效率版本(求助高人解释某条语句) 液晶屏幕显示数据!!! 有谁之前做过? JAVA swing 里如何镶嵌 system.in 的东西 2个面试题 在一个Swing图形窗口中,怎样得到当前获得焦点的组件? 请问用jet把jar文件转成exe问题。。。。。我遇到找不到莫块问题。。。。。 哪位好心的大哥教我,关于事件的激活 SCO OpenServer下的Java问题 求一个多线程结构 【疑问】内存分析,在Java程序中的作用
jdk-6u10还没有正式发布,可以在http://download.java.net/jdk6/binaries/进行下载
publicclassTranslucentWindowextendsJFrame{
publicTranslucentWindow(){
super("透明窗体");
this.setLayout(newFlowLayout());
this.add(newJButton("按钮"));
this.add(newJCheckBox("复选按钮"));
this.add(newJRadioButton("单选按钮"));
this.add(newJProgressBar(20,100));
this.setSize(newDimension(400,300));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
publicstaticvoidmain(String[]args){
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(newRunnable(){
publicvoidrun(){
Windoww=newTranslucentWindow();
w.setVisible(true);
com.sun.awt.AWTUtilities.setWindowOpacity(w,0.6f);
}
});
}
}
publicclassTranslucentWindowextendsJFrame{
publicTranslucentWindow(){
super("透明窗体");
this.setLayout(newFlowLayout());
this.add(newJButton("按钮"));
this.add(newJCheckBox("复选按钮"));
this.add(newJRadioButton("单选按钮"));
this.add(newJProgressBar(20,100));
this.setSize(newDimension(400,300));
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
publicstaticvoidmain(String[]args){
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(newRunnable(){
publicvoidrun(){
Windoww=newTranslucentWindow();
w.setVisible(true);
com.sun.awt.AWTUtilities.setWindowOpacity(w,0.6f);
}
});
}
}来自http://wenwen.soso.com/z/q131333431.htm
使用带alpha分量的Color fill算透明不?