The Swing library consists of classes for writing GUI applications in Java. Table A.10 lists the classes and their equivalents.
Java | .NET |
---|---|
AbstractButton | System.Windows.Forms.ButtonBase |
AbstractListModel | System.Windows.Forms.ListControl |
AbstractSpinnerModel | System.Windows.Forms.UpDownBase |
ImageIcon | System.Windows.Forms.Image |
JButton | System.Windows.Forms.Button |
JCheckBox | System.Windows.Forms.CheckBox |
JColorChooser | System.Windows.Forms.ColorDialog |
JComboBox | System.Windows.Forms.ComboBox |
JComponent | System.Windows.Forms.UserControl |
JDialog | System.Windows.Forms.CommonDialog |
JEditorPane | System.Windows.Forms.TextBoxBase |
JFileChooser | System.Windows.Forms.OpenFileDialog |
JFormattedTextField | System.Windows.Forms.RichTextBox |
JFrame | System.Windows.Forms.Form |
JLabel | System.Windows.Forms.Label |
JList | System.Windows.Forms.ListBox |
JMenuBar | System.Windows.Forms.MainMenu |
JMenuItem | System.Windows.Forms.MenuItem |
JPanel | System.Windows.Forms.Panel |
JPasswordField | System.Windows.Forms.TextBox |
JPopupMenu | System.Windows.Forms.ContextMenu |
JProgressBar | System.Windows.Forms.StatusBar |
JRadioButton | System.Windows.Forms.RadioButton |
JScrollBar |
System.Windows.Forms.HScrollBar System.Windows.Forms.VScrollBar |
JScrollPane | System.Windows.Forms.Panel |
JSlider | System.Windows.Forms.TrackBar |
JSpinner | System.Windows.Forms.DomainUpDown |
JSplitPane | System.Windows.Forms.Splitter |
JTabbedPane | System.Windows.Forms.TabControl |
JTable | System.Windows.Forms.ListView |
JTextArea | System.Windows.Forms.TextBox |
JTextField | System.Windows.Forms.TextBox |
JTextPane | System.Windows.Forms.RichTextBox |
JToggleButton | System.Windows.Forms.ButtonBase |
JToolBar | System.Windows.Forms.ToolBar |
JToolTip | System.Windows.Forms.ToolTip |
JTree | System.Windows.Forms.ListView |
Popup | System.Windows.Forms.ContextMenu |
Timer | System.Windows.Forms.Timer |
Table A.11 shows the comparison between javax.swing.event package classes and their .NET equivalents.
The .NET Framework does not provide directly equivalent classes for the following packages: javax.swing.plaf, javax.swing.border, javax.swing.table, javax.swing.text (although you can use System.Windows .Form.RichTextBox), and javax.swing.filechooser (although you can use System.Windows.Forms.OpenFileDialog and System.Windows.Forms.SaveFileDialog).
Java | .NET |
---|---|
CaretEvent | System.EventArgs |
ListDataEvent | System.EventArgs |
ListSelectionEvent | System.EventArgs |
MenuEvent | System.EventArgs |
PopupMenuEvent | System.EventArgs |
3.128.94.171