问题标签 [contentpane]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 从另一个类中调用一个变量
我正在为我的一个类编写原始地址簿的代码,我们需要为地址簿本身使用一个类,然后使用另一个类来放入新条目。我明白这一点,但是当我调用输入新联系人的类方法时,我想更改 GUI。我正在使用 JFrame,因此对于我的 GUI 基础,我使用的是contentPane
. 在我的第一堂课中,我contentPane
用一个基本的 GUI 创建了我的:
现在在我的第二节课中,输入一节,我想清除contentPane
with contentPane.removeAll()
。
不幸的是,我的班级条目中没有任何内容可以识别contentPane
以及我正在尝试修改的其他变量。有没有一种特殊的方法来命名contentPane
类地址中的变量和其他变量,以便它们在条目中可用,或者我需要重新创建变量吗?
java - Swing:绘制所有其他组件并保留事件
我正在尝试做的事情:绘制一条垂直线和一条水平线,它们相互垂直并在鼠标指向的位置相交。一种光标跟踪器。
我的结构:JFrame -> CustomPanel -> 其他面板/组件等。
CustomPanel 继承自 JPanel,它被设置为我的 JFrame 的 ContentPane。
我尝试使用 GlassPane,一切正常,但我想保留我的事件,而不是禁用它们。我仍然希望能够单击按钮等。
一个相关的问题是这幅画在 Swing 中的组件顶部?. 当我将鼠标移动到我的 CustomPanel 中的空白位置时,一切都按预期运行,但它仍然没有绘制在其他组件上。
在图像中,它应该继续在按钮上绘画,但是当我进入它时它停止了,然后在我退出时又恢复了。
代码如下。
和我的适配器:
highcharts - Highcharts 条形图工具提示多个内容窗格在 FireFox 中制动
我创建了一个使用内容窗格的应用程序。每个页面都在主内容窗格中加载,其他页面以选项卡格式打开,因此用户可以来回翻转而不必重新加载页面。
我在每个页面上添加了多个 Highchart 图表。一切看起来都很棒!当用户单击每个页面时,图表加载正常。当您单击每个选项卡/页面时,条形图看起来不错;但是,工具提示仅适用于 FireFox 中的第一个条形图。令人惊讶的是,IE 可以正常工作,并且页面上的其他图表显示工具提示很好。
每个图表都有一个唯一的 ID。我注意到以相同方式使用的其他图表(饼图)可以正常工作并按预期显示工具提示。这个问题似乎与条形图有关。
有任何想法吗?
javascript - 包含附加点的 dijit contentpane 内容
像这样的东西:
哪里newTabTemplate
是:
现在,我想cp.editor
工作,因为editor
在 cp 的模板中命名了一个附加点。但它说undefined
。有什么办法吗?
实例化正确发生,即视觉输出正确,只有附加点不起作用。
java - 为什么秋千中的 Container 有太多的层次感?
谁能告诉我下面的代码有什么区别
和
即使我不清楚 RootPane、LayeredPane、GlassPane。RootPane 有什么用??我从来没有在我的编码中使用过它。我已从以下链接中阅读
http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html
但不太清楚,因为我没有使用上述的实际情况。感谢您的回答!!
java - getComponentAt() 找不到组件?
我正在使用 aJFrame
设置纸牌游戏,使用扩展的卡片,JLabel
以便可以在屏幕上拖动它们。但是,我的一个要求是我能够双击一张牌,它可以捕捉到 4 叠 A。这不是问题。造成问题的原因是我将它设置在一个数组中,以便 A 会到达与 A 的花色相对应的位置,然后如果将一张牌拖到那里,我会重新排列这些位置。如果双击,则 A 必须先到第一个位置(从左边开始),然后是第二个,依此类推。我曾计划用getComponentAt()
找出第一个位置是什么,如果我可以将 ace 放在那里,如果不能,那么我会转到第二个位置,依此类推。出于某种原因,即使我将参数硬编码到getComponentAt()
到我知道有一个组件的地方,它仍然返回 null。
这是我的代码的相关部分:
null
每次都会返回,无论我将坐标放在组件的哪个位置。有什么解释吗?
*更新的 SSCCE:这是主要课程,纸牌:
这是班级卡:
这是为我运行的,如果您需要更多来解决问题,请发表评论。
java - Change content pane on button press
I want a button to change the contentPane in a frame. An admin panel and a user panel in two different JPanel classes that gets called in a MainWindow class with a frame.
My code looks as follows:
The method the button calls:
This is the method being called in my "public MainWindow()" method in the MainWindow class (the one with the frame) to show the contentPane in the beginning:
An equal method exists for the userUI.
I have tried just called the userUI() method in the MainWindow when I press a button, but that doesn't refresh the window, and neither does the ChangeConten() method. I need some help. I used the search feature on Stackoverflow to no success.
xhtml - javascript 内容未加载,如果我使用 .xhtml 作为输入动态创建选项卡/内容窗格
我正在 home.xhtml 文件中创建如下动态选项卡/内容窗格,我试图调用 order.xhtml 中存在的函数显示,它没有被调用。没有加载 order.xhtml 中的任何 java 脚本。
在 home.xhtml 中
javascript in order.xhtml
dojo - 在动态加载到 contentPane 的文件中包含“dojo.js”的问题
我正在 home.xhtml 文件中创建一个动态选项卡/contentPane,如下所示。在 order.xhtml 文件中,我包括 dojo.js,如下所示。它已经包含在 home.xhtml 中。所以我收到“错误:defineAlreadyDefined”。但是,如果我从 order.xhtml.error 中删除该行,则该行不会出现,但页面仍未加载,它会像以前一样停在同一行,但没有该错误。
在 home.xhtml 中
在 order.xhtml
请帮我解决这个问题
javascript - Dojox ContentPane styles not working
I have 2 html pages A and B. Page A has a dojox/layout/contenpane as follows:
I am loading the page B inside A using the href attribute of the ContentPane (uses XHR). Page B does show in the ContentPane, but I have 2 problems with this:
1) Page B body tag has a class="claro" attribute which is ignored. (I realized this by comparing the B loaded inside A against just B loaded in a separate browser tab). How do I make this work?
2) The included styles in B overwrite that of the parent page (eg. Body of A has margin:auto, and that of B has margin:0. When I load the ContentPane in A with B, everything in the A shifts from center to left). How do I confine the styles of B just to itself.
I tried looking online for several hours, but I am not making any progress. Any help is appreciated.