『壹』 java如何獲取單選按鈕RadioButton的值
JRadioButton jrb=new JRadioButton("男");
JRadioButton jrb1=new JRadioButton("女");
String sex=null;
if(jrb.isSelected()){
sex="男";
}
else{
sex="女";
}
不知道你說的是不是這個內意思容....
『貳』 在jsP中如何獲取Button按鈕中的Value值
1、創建一來個名稱為 type_button 的html文件 。
『叄』 請問在jsp頁面有兩個按鈕,在後台java程序中如何判斷用戶點擊的是哪個按鈕例如:
在<form>標簽內加來一個隱藏欄位
<input type="hidden" name="type" id="type"/>
function examine(type){
document.getElementById("type").value=type;
if(confirm("確定源?")){
document.f1.submit();
}
<input type="button" name="agree" value="同意" onclick="examine('1')"/>
<input type="button" name="disagree" value="不同意" onclick="examine('0')">
在action中接收type的值就可以知道是同意還是不同意
『肆』 請問在java中怎麼使用jna 獲取說有的窗口句柄
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HWND;
public class Demo1 {
public static void main(String[] args) {
name();
}
//窗體句柄的截獲
public static void name() {
// HWND hwnd = User32.INSTANCE.FindWindow(null, "列印");
String zh="列印";
HWND hwndDialog = User32.INSTANCE.FindWindow(null,zh);
if(hwndDialog==null) {
System.err.println("沒有找到窗體");
}else {
System.err.println("找到窗體"+hwndDialog);
//HWND root, String className, long timeout, TimeUnit unit,String caption
// List<HWND> hwndButton= Win32Util.findHandleByClassNameJKSD(hwndDialog,"Button", 10, TimeUnit.SECONDS,"列印");
// for (HWND hwnd : hwndButton) {
// System.err.println(hwnd);
// }