小编Cha*_*Des的帖子

Swing:将鼠标悬停在半透明JPanel上的单选按钮标签上

在我的问题中,我有一个不透明的JPanel和另一个半透明(半透明)的JPanel,它位于第一个JPanel上.当我在顶部JPanel上添加单选按钮时.问题是每当我在每个单选按钮的标签区域上输入鼠标时(每次我将鼠标从标签上移开),它会变得越来越暗.

package trial;

import java.awt.Color;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

public class Test {

public static void main(String arg[]){
    JFrame rootframe = new JFrame("Test panel");
    rootframe.setSize(800, 550);
    rootframe.setExtendedState(JFrame.MAXIMIZED_BOTH);

    JPanel basePanel = new JPanel(); //fills rootFrame
    basePanel.setOpaque(true);
    basePanel.setBackground(Color.yellow );     

    JPanel panelContainingRadioButtons = new JPanel();//wraps radio buttons
    panelContainingRadioButtons.setOpaque(true);
    panelContainingRadioButtons.setBackground(new Color(0,0,0,100) );

    ButtonGroup buttonGroup1 = new ButtonGroup();

    JRadioButton jRadioButton1 = new JRadioButton();
    jRadioButton1.setText("Text A...............................");
    jRadioButton1.setOpaque(false);
    jRadioButton1.setForeground( Color.white);
    buttonGroup1.add(jRadioButton1);

    JRadioButton jRadioButton2 = new JRadioButton();
    jRadioButton2.setOpaque(false);
    jRadioButton2.setForeground( Color.white);
    buttonGroup1.add(jRadioButton2);
    jRadioButton2.setText("Text B.......................");

    JRadioButton …
Run Code Online (Sandbox Code Playgroud)

java swing jpanel jradiobutton translucency

6
推荐指数
1
解决办法
1755
查看次数

强制 selenium 使用便携式 Firefox 应用程序

我已经安装了 Firefox 14 并在机器上安装了 Firefox便携版 25.0.1,我在那里运行了一个网站的测试。

由于我正在测试的站点的限制,我无法在 Firefox 14 安装上运行我的测试。我也无法升级 firefox 14 安装。

所以我正在寻找一个解决方案,我可以使用这个便携式 Firefox 版本而不是安装的 Firefox 14 版本。

我应该如何强制 selenium 使用这个便携版本而不是安装版本?如果有人可以将我引向一些描述性文章/博客,那就太好了。

我的代码是这样的:-

* 变量 *

${SELENIUM_HUB}     remote_url=http://127.0.0.1:4444/wd/hub
${BROWSER}      firefox D:\\Firefox Portable\\FirefoxPortable\\firefox.exe
${CLIENT_URL}       https://abcd.aline.local

Open Browser    ${CLIENT_URL}    ${BROWSER}   ${SELENIUM_HUB}
Run Code Online (Sandbox Code Playgroud)

将路径指定为 D:/Firefox Portable/FirefoxPortable/firefox.exe 不起作用,因为“/”已被删除。有什么想法吗?

PS:python是使用的语言

python firefox selenium robotframework

6
推荐指数
1
解决办法
6805
查看次数

将json格式的字符串解析为json并使用c#创建jsonresult类型对象

我有一个非常复杂的字符串代表一个json对象.我需要将其转换为某种形式,以便我可以在MVC控制器中将其作为JsonResult返回.

string result = "[
{
    ""TagGroupName"": ""group1"",
    ""Tags"": [
        {
            ""TagName"": ""G1tag1""
        },
        {
            ""TagName"": ""G1tag2""
        },
        {
            ""TagName"": ""G1tag3""
        }
    ]
},
{
    ""TagGroupName"": ""group2"",
    ""Tags"": [
        {
            ""TagName"": ""G2tag1""
        },
        {
            ""TagName"": ""G2tag2""
        }
    ]
}
]";
Run Code Online (Sandbox Code Playgroud)

该字符串是动态构建的.

不确定我是否在正确的轨道,但我使用NewtonSoft将其解析为"JObject",但我还需要将此字符串转换为JsonResult类型(应该被Jquery识别为Json对象)

c# asp.net-mvc json jsonresult

0
推荐指数
1
解决办法
1078
查看次数