0
我正在嘗試打電話給一個號碼或任何隨機語音服務,因爲這不需要功能,因爲這是一個學校項目。這是我的jframe的代碼。如何從我的Java應用程序撥打語音電話?我如何使這個程序工作?
我想要做的是,當我點擊通話圖標時,它會呼叫號碼或語音程序。
public class Counselling extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Counselling frame = new Counselling();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Counselling() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 510, 450);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnNewButton = new JButton("");
Image images = new ImageIcon(this.getClass().getResource("/call.png")).getImage();
btnNewButton.setIcon(new ImageIcon(images));
btnNewButton.setBounds(106, 92, 268, 133);
contentPane.add(btnNewButton);
JButton button = new JButton("");
button.setBackground(Color.WHITE);
Image images2 = new ImageIcon(this.getClass().getResource("/msg.png")).getImage();
button.setIcon(new ImageIcon(images2));
button.setBounds(106, 241, 268, 125);
contentPane.add(button);
JLabel lblNewLabel_1 = new JLabel("");
Image images1 = new ImageIcon(this.getClass().getResource("/oc.png")).getImage();
lblNewLabel_1.setIcon(new ImageIcon(images1));
lblNewLabel_1.setBounds(38, 16, 435, 60);
contentPane.add(lblNewLabel_1);
}
}
很抱歉,但這個問題和代碼是創建一個「Hello World」程序,並要求它用它發射NUCL相當於耳朵導彈。你沒有證明你已經完成了對真正重要的程序部分的研究。 –