Я должен отредактировать некоторый код для назначения, и он дал нам структуру и хочет, чтобы мы реализовали код для нее. Я загружаю проект в netbeans и не могу понять, как я должен редактировать компоненты свинга. Я не вижу, как редактировать исходный код или дизайн.
import javax.swing.*;
import java.util.*;
import java.io.*;
public class CurrencyConverterGUI extends javax.swing.JFrame {
/**************************************************************************************************************
insert your code here - most of this will be generated by NetBeans, however, you must write code for the event listeners and handlers for the two ComboBoxes, the two TextBoxes, and the Button. Please note you must also
poulate the ComboBoxes withe currency symbols (which are contained in the KeyList attribute of
CurrencyConverter CC)
***************************************************************************************************************/
private CurrencyConverter CC;
private javax.swing.JTextField Currency1Field;
private javax.swing.JComboBox Currency1List;
private javax.swing.JTextField Currency2Field;
private javax.swing.JComboBox Currency2List;
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
}
class CurrencyConverter{
private HashMap HM; // contains the Currency symbols and conversion rates
private ArrayList KeyList; // contains the list of currency symbols
public CurrencyConverter() {
/**************************************************
Instantiate HM and KeyList and load data into them.
Do this by reading the data from the Rates.txt file
***************************************************/
}
public double convert(String FromCurrency, String ToCurrency, double amount){
/***************************************************************************
Will return the converted currency value. For example, to convert 100 USD
to GBP, FromCurrency is USD, ToCurrency is GBP and amount is 100. The rate
specified in the file represent the amount of each currency which is
equivalent to one Euro (EUR). Therefore, 1 Euro is equivalent to 1.35 USD
Use the rate specified for USD to convert to equivalent GBP:
amount / USD_rate * GBP_rate
****************************************************************************/
}
public ArrayList getKeys(){
// return KeyList
}
}
Это то, что нам дали, но я ничего не могу с этим поделать в редакторе GUI. (Не могу даже добраться до редактора GUI). Я смотрю на это около часа. Есть идеи?