What's the better choice? For: Swing and AWT
I am asking this question because I am wondering what would save me more time.
What's the better choice? For: Swing and AWT
I am asking this question because I am wondering what would save me more time.
What's the better choice ? For: Swing and .awt
Swing is a more robust and powerful library for most purposes.
I am asking this question because I am wondering what would save me more time.
Save you more time in what way?
What actually is the thrust of this question?
Edit
You state:
I am making a CAD program, that's why I need to know.
I'm not sure that I'd be worried so much about "clearing vs. drawing on top" at this point and would be more worried about overall program design with good separation of logical entities. The graphics details can be tested and changed depending on the results of your testing, but more important is that you have a robust and flexible design, one that will allow you to plug in any type of graphics design.
On-top of all the other comments;
Swing has a clever repaint manager which can be used to only repaint damaged areas of the screen, rather then need to repaint the whole screen.
Swing is also double buffered, which makes it's updates less prone to flickers.
Generally speaking clearing and redrawing is the preferred approach. There are often visual bugs in programs that try to draw on top.
The typical use case of drawing on top is to eliminate some of the problems related to programs that have difficult to draw widgets (such as CAD programs with very intricate details with lots of features). However, even in these cases there is usually some way of avoiding drawing on top. For instance drawing the CPU intense widget to a buffer and then drawing the buffer whenever something not in that widget is changed.
swing will save your more time than awt as all the code of components of swing are purely written in java whereas of awt code of components are written in native language that is other than java thus compilation time of awt is more than swing. Swing is best in case of time saving.