你可以用JInternalFrame,它有void setMaximum(boolean b);
解决方案 »
- 初学求有经验者给点意见
- jave该怎么学和入门
- 菜鸟提问个超简单问题啊!!!!高手多多指教
- 在c++下能显示内存的地址,java有没有什么方法可以显示变量的内存地址
- -----怎样将应用程序打包为一个可执行的.jar 文件------
- 这句话什么意思..在线..
- applet与数据库的交互:策略文件已配置,用appletviewer可以正确读出数据,而嵌入到网页中却不能读出数据,这是为什么啊!~~~~~~~~~~
- javamail发送有图片的html问题,(多张图片)
- 输入问题:见内!
- 每日一问之Java/Weblogic访问数据库篇
- 有什么办法自动在客户端安装jre1.3.1?
- 如何配置jrun?
//看看这。
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;public class RobotDemo {
public static void main(String args[]) throws AWTException {JFrame frame = new JFrame("RobotDemo");
frame.setSize(200, 150);
frame.setLocation(200, 200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);// create a robot to feed in GUI events
Robot rob = new Robot();// move cursor to the top, left corner
Point p = frame.getLocationOnScreen();
rob.mouseMove(p.x + 5, p.y + 5);// press and release left mouse button
rob.mousePress(InputEvent.BUTTON1_MASK);
rob.mouseRelease(InputEvent.BUTTON1_MASK);// send an 'x' key press
rob.keyPress(KeyEvent.VK_X);
}
}
//在看看这
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;public class MaxFrame extends JFrame {
JButton button = new JButton("hit me");
public MaxFrame(){
getContentPane().add(button);
setVisible(true);
setSize(100,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
// create a robot to feed in GUI events
Robot rob = new Robot();
// move cursor to the top, left corner
Point p = getLocationOnScreen();
rob.mouseMove(p.x + 5, p.y + 5);
// press and release left mouse button
rob.mousePress(InputEvent.BUTTON1_MASK);
rob.mouseRelease(InputEvent.BUTTON1_MASK);
// send an 'x' key press
rob.keyPress(KeyEvent.VK_X);
}
catch (Exception exc) {
System.err.println(exc);
}
}
}); }
public static void main(String args[]){
MaxFrame f = new MaxFrame();
f.show();
}
}
如果不是Windows平台也可以实现吗?