我正试图让Aero Glass看上去JPanel.有可能做这样的事吗?
如何添加Aero效果JFrame- 就像这张照片?

如何更改相对布局形状的颜色?像按钮一样工作.我尝试使用选择器来做到这一点.
这是我使用的代码.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlGPS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:background="@drawable/relative_selector"
>
<ImageView
android:id="@+id/iv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/tvs1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_below="@+id/tvl1"
android:layout_toLeftOf="@+id/iv1"
android:text="you can here protect ... "
android:textColor="@color/gray" />
<TextView
android:id="@+id/tvl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/iv1"
android:text="GPS"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/white" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
relative_selector.xml在这里,我正在使用选择器进行更改.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@drawable/relative_focus"/>
<item android:state_pressed="true" android:state_enabled="false"
android:drawable="@drawable/relative_clicked" />
<item android:drawable="@drawable/relative_background"/>
</selector>
Run Code Online (Sandbox Code Playgroud)
relative_background.xml这是形状.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle">
<stroke android:width="1dp" android:color="#636161" />
<padding android:left="5dp"
android:top="2dp"
android:right="2dp"
android:bottom="5dp" …Run Code Online (Sandbox Code Playgroud) 我想用JOptionPanes 处理一些例外.这是主要方法:
public class MainRun {
public static void main(String args[]){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new SubstanceRavenGraphiteGlassLookAndFeel());
}catch (Exception e){
e.printStackTrace();
}
new MainGui().setVisible(true);
new Initialized().start();
new PriorityMessageQueue().start();
}
});
Run Code Online (Sandbox Code Playgroud)
MainGui是JFrame应用程序的主窗口().我在PriorityMessageQueue线程中处理了异常.
public class PriorityMessageQueue extends Thread {
@Override
public void run() {
while (true) {
try {
instantMessages = instant.getMobitelMessagesToBeSent();
} catch (Exception ex) {
JOptionPane.showMessageDialog(
null,
ex.getMessage(),
"Database Error",
JOptionPane.ERROR_MESSAGE);
}
...
Run Code Online (Sandbox Code Playgroud)
在我运行之后,我收到了一个错误
org.jvnet.substance.api.UiThreadingViolationException: Component creation must …Run Code Online (Sandbox Code Playgroud) java ×2
swing ×2
aero-glass ×1
android ×1
joptionpane ×1
jpanel ×1
substance ×1
translucency ×1