-1
我有一個Swing GUI,其中60幀每秒在JWindow中呈現。在我使用2GB RAM的雙處理器時,我以720p運行這部電影。 CPU使用顯示99%+ RAM標準。與Java中的Swing相比,Awt是否使用較低的cpu和ram?
但是,當我交換圖形用戶界面AWT,我也看到類似的。 CPU/RAM使用情況。在這種情況下,我如何將CPU使用量降低到更低的水平?
public class MainSwing
extends JWindow
implements MouseListener, MouseMotionListener
{
public static JWindow j;
public MainSwing()
{
try {
this.setLayout (new BorderLayout());
screen = Toolkit.getDefaultToolkit().getScreenSize();
this.pack();
this.setVisible(true);
} finally {
}
}
public static void main(String[] args)
{
j = new MainSwing();
// load heavy load video games
}
}
VS
public class MainAwt
extends Window
implements MouseListener, MouseMotionListener
{
public static Window j;
public MainAwt()
{ super(new Frame());
try {
this.setLayout (new BorderLayout());
screen = Toolkit.getDefaultToolkit().getScreenSize();
this.pack();
this.setVisible(true);
} finally {
}
}
public static void main(String[] args)
{
j = new MainAwt();
// load heavy load video games
}
}
唯一相關的代碼這裏是你的應用程序的代碼。如果更改工具包不會改變性能特徵,那麼這是您需要查看/更改的代碼。沒有看到它,甚至沒有看到它的作用,這個問題是無法回答的。 – Mat
@Google問題提示:-) – mKorbel