Widget[class:class|path|URL[path],{content}]
defines a new widget instance.
Widget
Widget[class:class|path|URL[path],{content}]
defines a new widget instance.
更多信息和选项
- To use Widget, you first need to load GUIKit using Needs["GUIKit`"].
- The following options can be given:
-
InitialArguments None a list of arguments to use in the constructor for this widget instance Name None a name with which to register this instance in the widget registry ExposeWidgetReferences Automatic a list of widget names to expose from an internal definition
范例
打开所有单元 关闭所有单元基本范例 (1)
Needs["GUIKit`"]ref = GUIRun[Widget["Panel"]]GUIScreenShot[ref]Explicitly specify what Java class to use:
ref = GUIRun[Widget["class:javax.swing.JPanel"]]GUIScreenShot[ref]Specify constructor arguments:
ref = GUIRun[Widget["Label", { "text" -> "Hello World!"}]]GUIScreenShot[ref]Options (2)
InitialArguments (1)
Needs["GUIKit`"]ref = GUIRun[Widget["Label", InitialArguments -> { "Hello World!"}]]GUIScreenShot[ref]Name (1)
Needs["GUIKit`"]ref = GUIRun[Widget["Frame", {
Widget["Panel"]},
Name -> "myFrame"] ]ref@SetPropertyValue[{"myFrame", "title"}, "My Title"]The interface has been resized to display the entire title:
GUIScreenShot[ref]相关指南
文本
Wolfram Research (2007),Widget,Wolfram 语言函数,https://reference.wolfram.com/language/GUIKit/ref/Widget.html.
CMS
Wolfram 语言. 2007. "Widget." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/GUIKit/ref/Widget.html.
APA
Wolfram 语言. (2007). Widget. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/GUIKit/ref/Widget.html 年
BibTeX
@misc{reference.wolfram_2026_widget, author="Wolfram Research", title="{Widget}", year="2007", howpublished="\url{https://reference.wolfram.com/language/GUIKit/ref/Widget.html}", note=[Accessed: 19-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_widget, organization={Wolfram Research}, title={Widget}, year={2007}, url={https://reference.wolfram.com/language/GUIKit/ref/Widget.html}, note=[Accessed: 19-August-2026]}