Details about the known misuse from the MUBench dataset.
Description: | Calls JFrame.setVisible(true) before JFrame.pack(). This may lead to undesired effects, such as the window being moved to the default plattform location.
|
Fix Description: |
Call JFrame.pack() before JFrame.setVisible(true).
|
Violation Types: |
|
In File: | PackAfterVisible.java |
In Method: | misuse(JFrame) |
Code with Misuse: |
class PackAfterVisible {
public void misuse(JFrame f) {
f.setVisible(true);
f.pack();
}
}
|
Code with Pattern(s): |
public class PackBeforeVisible {
public void pattern(JFrame f) {
f.pack();
f.setVisible(true);
}
}
|