有问题的方法如下:
Public static String cut (String s, int size){
Return "";
}
答案 0 :(得分:0)
切断字符串JRadioButton button1 = new JRadioButton("M"),button2 = new JRadioButton(("F"));
button1.setHorizontalAlignment(SwingConstants.CENTER); button2.setHorizontalAlignment(SwingConstants.CENTER);
ButtonGroup bgroup1 = new ButtonGroup();
bgroup1.add(button1); bgroup1.add(button2);
JPanel radiobuttonpanel = new JPanel();
BoxLayout radiobuttonpanellayout = new BoxLayout(radiobuttonpanel, BoxLayout.X_AXIS);
radiobuttonpanel.setLayout(radiobuttonpanellayout);
radiobuttonpanel.add(button1); radiobuttonpanel.add(button2);
panel4.add(radiobuttonpanel);
。
如何使用的示例:
String.substring()
在你的情况下,它将是:
"hamburger".substring(4, 8) returns "urge"
"smiles".substring(1, 5) returns "mile"
文档:https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring(int,%20int)