2

while creating a JFrame derivative in eclipse, the quick fix given by eclipse is "import unimported files" and when I do the fix, it imports

 import javax.swing.JPanel;

and I have to import every file when I declare other components, Is it possible to change the quick fix option in eclipse, so that I could change it to

import javax.swing.*;

thanks for your works below in advance

  • 2
    Just type `Jbut` and it will auto-complete to JButton *and* add the import of JButton for you. Or type Ctrl-Shift-O to auto-import all the missing classes. Using wildcard imports is bad practice. You should avoid them. – JB Nizet Dec 15 '13 at 08:48

1 Answers1

1
  1. Choose the menu item: Window->Preferences.
  2. Select Java -> Code Style -> Organize Imports
  3. You can then select the number of items that are imported before Eclipse chooses to use a wildcard for that package. The default is 99.
jzd
  • 23,473
  • 9
  • 54
  • 76