gpt4 book ai didi

java - 使用合成器自定义外观 JPogressBar 和 JSplitPane xml

转载 作者:太空宇宙 更新时间:2023-11-04 06:46:31 29 4
gpt4 key购买 nike

我正在尝试使用合成器使用 xml 文件为我的程序制作自定义外观,并且运行良好,但我不确定如何自定义 JProgressBar 或 JSplitPane。我在 JProgressBar 上有边框,没有任何问题,但我找不到如何自定义加载动画。顺便说一句,加载栏设置为不确定。就 SplitPane 而言,我唯一难以工作的是分割 Pane 拖动分隔线。分割 Pane 在程序中工作正常,只是当您拖动它时,分割线不会显示。这是我当前的 xml 文件。感谢您的帮助。

<?xml version="1.0" encoding="utf-8"?>
<synth>
<style id="frameStyle">
<style id="backingStyle">
<opaque value="TRUE" />
<font name="Monaco" size="18" />
<state>
<color value="BLACK" type="BACKGROUND" />
<color value="GRAY" type="FOREGROUND" />
</state>
</style>
<bind style="backingStyle" type="region" key=".*" />
</style>


<style id="intputFieldStyle">
<insets top="0" left="4" bottom="4" right="4" />
<state>
<font name="Verdana" size="14" />
<color value="BLACK" type="BACKGROUND" />
<color value="WHITE" type="FOREGROUND" />
</state>
<imagePainter method="textFieldBorder" path="laf/txtfld.png"
sourceInsets="4 4 4 4" paintCenter="false" />
</style>


<style id="buttonStyle">
<state>
<font name="Monaco" size="12" />
<color value="LIGHT_GRAY" type="FOREGROUND" />
<imagePainter method="buttonBackground" path="laf/button_up.png"
sourceInsets="4 3 3 4" paintCenter="false" />
</state>
<state value="PRESSED">
<imagePainter method="buttonBackground" path="laf/button_down.png"
sourceInsets="4 3 3 4" paintCenter="false" />
</state>

<state value="MOUSE_OVER">
<imagePainter method="buttonBackground" path="laf/button_mouseover.png"
sourceInsets="4 3 3 4" paintCenter="false" />
</state>
</style>


<style id="userListStyle">
<state>
<font name="Monaco" size="12" />
<color value="LIGHT_GRAY" type="BACKGROUND" />
<color value="BLACK" type="FOREGROUND" />
</state>
<state value="SELECTED">
<font name="Monaco" size="12" />
<color value="MAGENTA" type="TEXT_BACKGROUND" />
<color value="BLACK" type="TEXT_FOREGROUND" />
</state>
</style>


<style id="labelStyle">
<state>
<color value="LIGHT_GRAY" type="FOREGROUND" />
</state>
</style>


<style id="loadingBarStyle">
<state>
<color value="BLUE" type="BACKGROUND" />
<color value="GREEN" type="FOREGROUND" />
<imagePainter method="progressBarBorder" path="laf/loadingbar_outside.png"
sourceInsets="6 6 6 6" paintCenter="false" />
</state>
</style>


<style id="panelStyle">
<state>
<color value="DARK_GRAY" type="BACKGROUND" />
</state>
</style>

<style id="splitPaneStyle">
<state>
<color value="WHITE" type="FOREGROUND"/>
</state>
</style>

<bind style="frameStyle" type="region" key="Frame" /> <!-- Bind Frame -->
<bind style="intputFieldStyle" type="region" key="TextField" /> <!-- Bind textBox -->
<bind style="labelStyle" type="region" key="Label" /> <!-- Bind label -->
<bind style="loadingBarStyle" type="region" key="ProgressBar" /> <!-- Bind loadingbar -->
<bind style="buttonStyle" type="region" key="Button" /> <!-- Bind Login buttons -->
<bind style="userListStyle" type="region" key="List" /> <!-- Bind user list -->
<bind style="panelStyle" type="region" key="Panel" /> <!-- Bind Panel -->
<bind style="splitPaneStyle" type="region" key="SplitPane" /> <!-- Bind Split Pane -->

最佳答案

经过几个小时搜索 Synth 源代码后,我解决了这个问题。拆分的键为 SplitPaneDivider,进度条的键为 ProgressBar。相应的方法是 splitPaneDragDividerprogressBarForeground/Background

关于java - 使用合成器自定义外观 JPogressBar 和 JSplitPane xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23902161/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com