我编写了一个代码,告诉您是否有资格投票......但是当我编译它时,它显示错误或警告消息说:
Vote.java uses unsafe or unchecked operations. Recompile with -Xlint:unchecked for details.
这是我的代码..
我做了更多的研究,但它没有帮助我...现在我无法编译它
`
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Vote extends JFrame {
JLabel ageEnquiry, result;
JComboBox<String> ageList;
JTextField results;
JButton val;
public Vote() {
String[] ages = new String[] {"10-17", "18-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"};
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
ageEnquiry = new JLabel("Select your age range: ");
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
add(ageEnquiry, c); …Run Code Online (Sandbox Code Playgroud)