Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一个 JCheckBox 将被插入到数据库中
String R=chckbxRsidentel.getSelectedObjects().toString(); String A=chckbxAffaire.getSelectedObjects().toString();
我假设您要根据选中的复选框将“R”或“A”插入数据库。如果两者都没有被选中,也许你还想插入,比如说“”。
你可以这样做:
char check = chckbxRsidentel.isSelected() ? "R" : chckbxAffaire.isSelected() ? "A" : " ";