鼠标悬停时出现组件

时间:2015-06-16 06:05:14

标签: java swing jbutton

我创建了一个swings应用程序,我想要做的是,在按钮点击时添加一些组件。我能够做到这一点,但问题是,这些组件只有在我将鼠标悬停在它们上方时才会出现。单击按钮后如何让它们出现?

JsonArray responseJson = [
{
    "currentvalue": [
        {
            "id": "13",
            "current_value": "0,1",
            "create_date": "2015-06-15 06:12:14",
            "status": "0",
            "modify_date": "0000-00-00 00:00:00",
            "entry_time": "",
            "indicator_id": "13",
            "member_id": "9"
        }
    ],
    "target": {
        "notification_time": "06:12:14",
        "id": "13",
        "health_selected_days": {
            "day": "3"
        },
        "point": "1",
        "indicator_name": "Test2",
        "create_date": "2015-06-15 06:12:14",
        "indicator_status": "0",
        "notification_type": "0",
        "modify_date": "2015-06-15 06:12:14",
        "indicator_measure": "0",
        "target_value": "0,1",
        "total_point": "0",
        "member_id": "9"
    }
},
{
    "currentvalue": [
        {
            "id": "12",
            "current_value": "0,1",
            "create_date": "2015-06-15 04:56:22",
            "status": "0",
            "modify_date": "0000-00-00 00:00:00",
            "entry_time": "",
            "indicator_id": "12",
            "member_id": "9"
        }
    ],
    "target": {
        "notification_time": "02:02:00",
        "id": "12",
        "health_selected_days": {
            "day": ""
        },
        "point": "1",
        "indicator_name": "Ashish",
        "create_date": "2015-06-15 04:56:22",
        "indicator_status": "0",
        "notification_type": "0",
        "modify_date": "2015-06-15 04:56:22",
        "indicator_measure": "0",
        "target_value": "0,1",
        "total_point": "0",
        "member_id": "9"
    }
},
{
    "currentvalue": [
        {
            "id": "11",
            "current_value": "0,1",
            "create_date": "2015-06-12 13:58:09",
            "status": "0",
            "modify_date": "0000-00-00 00:00:00",
            "entry_time": "",
            "indicator_id": "11",
            "member_id": "9"
        }
    ],
    "target": {
        "notification_time": "02:02:00",
        "id": "11",
        "health_selected_days": {
            "day": "1,2,3,4,5,6,7,"
        },
        "point": "123",
        "indicator_name": "A",
        "create_date": "2015-06-12 13:58:09",
        "indicator_status": "0",
        "notification_type": "0",
        "modify_date": "2015-06-12 13:58:09",
        "indicator_measure": "0",
        "target_value": "0,1",
        "total_point": "0",
        "member_id": "9"
    }
}];

for(int i=0;i<responseJson.length();i++)
{
    JsonObject currentJsonObj = responseJson.optJsonObject(i);
    JsonArray currentJsonA = responseJson.optJsonArray("currentvalue");
    for(int j=0;j<currentJsonA.length();j++)
    {
        JsonObject innerObj = currentJsonA.optJsonObject(j);
        String id = innerObj.optString("id");
        String currentValue = innerObj.optString("current_value");
    }
}

0 个答案:

没有答案