Shortcut to get rid of full class names

I have a lot of lines of code that are similar to this:

objectListPanel = new javax.swing.JPanel();
roomNameField = new javax.swing.JTextField();
rightPanel = new javax.swing.JPanel();
jTabbedPane = new javax.swing.JTabbedPane();
enterScriptPanel = new javax.swing.JPanel();

in that they all use the "Fully Qualified Name" for a class. Is there a way to quickly fix all of these to just use the class name?

objectListPanel = new JPanel();
roomNameField = new JTextField();
rightPanel = new JPanel();
jTabbedPane = new JTabbedPane();
enterScriptPanel = new JPanel();
2 Answers
  1. Find new javax.swing. and replace with new and then import it in the class.

    Use Ctrl + Shift + O keyboard shortcuts to organize imports automatically.

    read more...

    2014-07-11 21:07:14
  2. can you use an import? try placing the below line at the top of your java file.

    import javax.swing.*;
    
    Andreas2014-07-11 21:01:27
Related Articles
You Might Also Like