首页 \ 问答 \ 我需要从另一个JFrame启动JFrame并让它像独立应用程序一样运行,有帮助吗?(I need to launch a JFrame from another JFrame and have that run like independent applications, help?)

我需要从另一个JFrame启动JFrame并让它像独立应用程序一样运行,有帮助吗?(I need to launch a JFrame from another JFrame and have that run like independent applications, help?)

我有一个不积极呈现的JFrame,一个标准的基本Swing应用程序,当点击一个按钮时,我需要启动另一个JFrame。 第二个JFrame使用Swing的BufferStrategy进行主动渲染,并独立运行 - 但是,当我从另一个JFrame的ActionPerformed调用它时,两个JFrame都会冻结。

我知道使用Swing来完成这种行为是复杂的 - 我怎样才能解决它们?


I have one JFrame that's not actively rendered, a la standard basic Swing applications, which I need to launch another JFrame when a button is clicked. The second JFrame is actively rendered using Swing's BufferStrategy, and runs on its own independently - however, when I call it from the other JFrame's ActionPerformed both JFrames freeze.

I know there are complications in using Swing to accomplish this kind of behavior - how can I get around them?


原文:https://stackoverflow.com/questions/5696386
更新时间:2022-11-06 06:11

最满意答案

您正在添加一个具有已在该元素的另一个类中定义的属性的类。 这就是原因!Important是在这里工作。

如果你想用jQ只改变一个属性,试试用css(): $("#element").prop('disabled', true).css('background-color', 'eee');

或删除其他具有背景颜色的类并添加mydisabled。

也可以删除所有类并将其替换为其他类:

$("#element").prop('disabled', true).attr('class', 'mydisabled'); - 所以所有类都将被“mydisabled”类所取代


You are adding a class with a property that already defined in another class of that element. Thats why !Important works here.

If you want to change only one property with jQ, try use css(): $("#element").prop('disabled', true).css('background-color', 'eee');

Or remove other class with background color and add mydisabled.

Also can remove all classes and replace them with others:

$("#element").prop('disabled', true).attr('class', 'mydisabled'); - so all classes will be replaced by "mydisabled" class

相关问答

更多
  • 从列表中删除项目时,请尝试使用for ,然后向后迭代,而不是使用foreach 。 以下问题有一些与本文类似的解决方案: 在ForEach中安全删除DataRow 所以,像这样的东西(我没有测试过这段代码,但这是一般的想法): // Iterate over each control to remove, and remove it for (int i = panel1.Controls.Count - 1; i >= 0; i--) { var item = panel1.Controls[i ...
  • 您正在添加一个具有已在该元素的另一个类中定义的属性的类。 这就是原因!Important是在这里工作。 如果你想用jQ只改变一个属性,试试用css(): $("#element").prop('disabled', true).css('background-color', 'eee'); 或删除其他具有背景颜色的类并添加mydisabled。 也可以删除所有类并将其替换为其他类: $("#element").prop('disabled', true).attr('class', 'mydisabled' ...
  • 有几种方法可以做到这一点: 将所有相关控件附加到删除按钮的Tag属性。 创建一个封装按钮和文本框的用户控件。 选项1:Tag属性 创建控件时,将关联的控件添加到按钮的.Tag属性中: Dim button As Button = New Button Dim textbox As TextBox = New TextBox button.Tag = {textbox} ' Add the button and textbox to the UI surface 现在,当单击该按钮时,您可以循环关联的控 ...
  • 只要添加了文本框就可以运行选择器,以下内容将起作用: $(".newDate").last().val() As long as the selector is run once the textboxes have been added, the following will work: $(".newDate").last().val()
  • 可能你可以使用$('#test-cell')。after()。html('') This is my mistake only. Table has keydown event to havigate across the rows using navigation keys where function is calling event.preventDefault for all the keys.
  • 要检查php是否存在文本框,请使用: if(isset($_POST['textboxn'])) { } 您还可以在一个循环中检查每个文本框 for($i = 0; i< 10; i++) { if(isset($_POST['textbox'+i])) { } } To check with php if textbox exists use : if(isset($_POST['textboxn'])) { } You can also check every tex ...
  • 您只需在添加新元素后初始化datepicker。 只需添加$( ".datepicker" ).datepicker(); 添加新文本框后。 它会工作。 检查: https : //jsfiddle.net/koqppkuf/ You just need to initialize datepicker after adding new element. Just add $( ".datepicker" ).datepicker(); after adding new textbox. It will w ...
  • HTML - index.html T-SUMM