AWT и Swing
Изучите различия между AWT и Swing в структурированной таблице сравнения, а затем перейдите к связанным вопросам для интервью, тестам и похожим сравнениям.
Разница между
AWT и Swing - ключевое сравнение тем, которое поможет понять, что лучше подходит для вашего случая. Здесь также можно сравнить Swing и AWT для подготовки к собеседованию.
Разница между AWT и Swing
AWT и Swing - ключевое сравнение тем, которое поможет понять, что лучше подходит для вашего случая. Здесь также можно сравнить Swing и AWT для подготовки к собеседованию.
|
AWT
|
Swing
|
|---|---|
| AWT components are called Heavyweight component. | Swings are called light weight component because swing components sits on the top of AWT components and do the work. |
| AWT components are platform dependent. | Swing components are made in purely java and they are platform independent. |
| AWT components require java.awt package. | Swing components require javax.swing package. |
| AWT is a thin layer of code on top of the OS. | Swing is much larger. Swing also has very much richer functionality. |
| AWT stands for Abstract windows toolkit. | Swing is also called as JFC (Java Foundation classes). It is part of Oracle's Java Foundation Classes (JFC). |
| These feature is not available in AWT. | Swing has many advanced features like JTabel, Jtabbed pane which is not available in AWT. Also. Swing components are called "lightweight" because they do not require a native OS object to implement their functionality. JDialog and JFrame are heavyweight, because they do have a peer. So components like JButton, JTextArea, etc., are lightweight because they do not have an OS peer. |
| This feature is not supported in AWT. | We can have different look and feel in Swing. |
| Using AWT, you have to implement a lot of things yourself. | Swing has them built in. |
| With AWT, you have 21 "peers" (one for each control and one for the dialog itself). A "peer" is a widget provided by the operating system, such as a button object or an entry field object. | With Swing, you would have only one peer, the operating system's window object. All of the buttons, entry fields, etc. are drawn by the Swing package on the drawing surface provided by the window object. This is the reason that Swing has more code. It has to draw the button or other control and implement its behavior instead of relying on the host operating system to perform those functions. |
Сохранить для повторения
Добавьте этот элемент в закладки, отметьте как сложный или поместите в набор для повторения.
Войдите, чтобы сохранять закладки, сложные вопросы и наборы для повторения.
Связанные сравнения
Изучите похожие сравнения, связанные с AWT и Swing, чтобы получить больше контекста и лучше подготовиться к интервью.
Смотрите различия ниже
Просмотрите все доступные сравнения ниже или воспользуйтесь поиском выше, чтобы быстро сузить список.