java弹出新窗口代码 java弹出结果窗口代码

JAVA中打开新页面代码/**
* 打开打印窗口
* url:链接页面或action动作
* Banglu
*/
function printWindow(url){
var sURL = url;
【java弹出新窗口代码 java弹出结果窗口代码】var sFeatures = "toolbar=no, menubar=no, scrollbars=no,resizable=yes, "
"location=no, status=no, titlebar=no, width=800, height=600, top=100, left=100";
window.open(sURL,'notoolbar',sFeatures);
}function exportWindow(url){
var sURL = url;
var sFeatures = "toolbar=no, menubar=no, scrollbars=no,resizable=yes, "
"location=no, status=no, titlebar=no, width=800, height=600, top=50, left=50";
var objwin=window.open(sURL,'export' randomNum(),sFeatures);
objwin.close();
}
/**
* 打开模态窗口
* url:链接页面或action动作
* width:打开模态窗口的宽度
* height:打开模态窗口的高度
* 注意:打开模态窗口的页面中要在head后面加上
* meta http-equiv="Pragma" content="no-cache":禁止模态窗口缓存
* base target="_self"/:模态窗口中的表单在本窗口中提交
* a onClick='window.location = "view-source:"window.location.href'b源文件/b/a 可以查看模态窗口的源文件
* Banglu
*/
function modalWindow(url, width, height){
var sURL = url;
var sFeatures = "dialogWidth:"width"px; dialogHeight:"height"px; "
"help:no; scroll:yes; center:yes; status:no;resizable:yes";
window.showModalDialog(sURL, window, sFeatures);
}/**
* 打开普通窗口
* url:链接页面或action动作
* width:宽度
* height:高度
* Banglu
*/
function openWindow(url, width, height){
var sURL=url;
var sFeatures = "scrollbars=yes, status=yes, resizable=yes,"
"toolbar=yes, menubar=yes, location=yes, titlebar=yes"
if(width!=null){
sFeatures =", width=" width;
}
if(height!=null){
sFeatures =", height=" height;
}
window.open(sURL, 'open' randomNum(), sFeatures);
}/**
* 打开窗口
* url:链接页面或action动作
* width:宽度
* height:高度
Banglu
*/
function openNoBarWindow(url, width, height){
var sURL=url;
var sFeatures = "scrollbars=no, status=no, resizable=no,"
"toolbar=no, menubar=no, location=no, titlebar=no"
if(width!=null){
sFeatures =", width=" width;
sFeatures =", left=" (screen.width-width)/2;
}
if(height!=null){
sFeatures =", height=" height;
sFeatures =", top=" (screen.height-height-100)/2;
}
window.open(sURL, 'openNoBar' randomNum(), sFeatures);
}
/**
* 打开全屏窗口
* url:链接页面或action动作
* Banglu
*/
function openFullWindow(url){
var sURL=url;
var sFeatures = "toolbar=no, menubar=no, scrollbars=no, resizable=yes, "
"location=no, status=no, titlebar=no, width=" (screen.width-10) ", "
"height=" (screen.height-60) ", top=0, left=0";
window.open(sURL, 'full' randomNum(), sFeatures);
}/**
* 打开主窗口
* url:链接页面或action动作
* Banglu
*/
function openMainWindow(url){
var sURL=url;
var sFeatures = "toolbar=no, menubar=no, scrollbars=no, resizable=yes, "
"location=no, status=no,titlebar=no, width=" (screen.width-10) ", "
"height=" (screen.height-60) ", top=0, left=0";
window.open(sURL, 'main', sFeatures);
}
/**
* 设置链接
* url:连接的jsp页面或action动作
* Banglu
*/
function link(url, frameID){
if(frameID==null){
window.location.href = https://www.04ip.com/post/url;
}
else{
window.frames[frameID].location = url
}
}/**
* 回车代替tab
* Banglu
*/
function handleKey(){
var gk = window.event.keyCode;
if (gk==13) {
if(window.event.srcElement.tagName!='TEXTAREA'){
window.event.keyCode=9;
return;
}
}
}/**
* 全屏显示
* Banglu
*/
function fullScreen(){
window.dialogHeight=window.screen.availHeight;
window.dialogWidth=window.screen.availWidth;
}
function Resize_dialog(t,l,w,h) {
window.dialogTop = t "px";
window.dialogLeft = l "px";
window.dialogHeight = h "px";
window.dialogWidth = w "px";
}
Java如何实现关闭一个窗口弹出另外一个窗口在Java中,对窗口任何操作都会对应的监听事件,故要实现关闭一个窗口时弹出另外一个窗口,只需要在该关闭的窗口的监听事件中添加弹窗事件即可 。
具体实现如下:
this.addWindowListener(new
WindowAdapter(){
@Override
public
void
windowClosing(WindowEvent
e)
{
setVisible(false);
new
JFrame("新窗口");
}});
在JavaGUI编程中,关闭窗口弹出新窗口是很常见的动作,比如一个窗口的业务操作完成了 , 需要跳转到另一个窗口继续执行 , 此时就需要关闭旧窗口并弹出新窗事件 。值得注意的地方时 , 有时候的关闭往往只是暂时的将旧窗口暂时隐藏,而不是真的关闭,因为之后可能还会继续用到,为了节省开销 , 暂时的隐藏有利于提供效率 。
java点击菜单项弹出窗口怎么弄代码缺一行:
。。。
authorTextArea.setPreferredSize(new Dimension(40, 80));
authorFrame.add(authorTextArea);
。。。
以上完了后 , 需要加一个
authorFrame.setVisible(true);
至于这个框的大?。阍俚鞯鞴?nbsp;, 相互学习~,三年没做过了~
关于java弹出新窗口代码和java弹出结果窗口代码的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读