Avatar of Peter Chan
Peter Chan
Flag for Hong Kong asked on

Issue to code

Hi,
How to resolve issue below in Eclipse?
7b.png
* EclipseJavaProgramming Languages-OtherLinux Distributions

Avatar of undefined
Last Comment
girionis

8/22/2022 - Mon
Jeffrey Dake

Looks like show forgot to import some classes. If you go to the eclipse “problems” view, it will give you more information about the problem.
Peter Chan

ASKER
Sorry, which packages should be imported to resolve it?

For instance, I see that

ResultSet cannot be resolved to a type

is the error on line below. How to resolve it?

       ResultSet rs = stmt.executeQuery(sql);

Open in new window

ASKER CERTIFIED SOLUTION
girionis

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Peter Chan

ASKER
How to disallow to edit the textarea below?
public class Main {
      public static void main( String[] args )
      {
            try
            {
                  final JFrame frame = new JFrame( "Information" );
                  final JPanel mainPanel = new JPanel();
                  mainPanel.setPreferredSize ( new Dimension( 800, 700 ) );
                  frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                  frame.getContentPane().add ( mainPanel );
                  frame.setLocationRelativeTo( null );

                  // JTextArea supports a subset of HTML and with that you
                  // can change fonts within the text.
                  final JTextArea textArea = new JTextArea(
                              "This is an editable JTextArea. "
                                          + "A text area is a \"plain\" text component, "
                                          + "which means that although it can display text "
                                          + "in any font, all of the text is in the same font." );
                  textArea.setFont( new Font( "Serif", Font.BOLD, 12 ) );
                  textArea.setLineWrap( true );
                  textArea.setWrapStyleWord( true );

                  mainPanel.add( textArea );

                  frame.pack();
                  frame.setVisible( true );      // should be last

                  beep();
            }
            catch( final Exception e )
            {
                  final JPanel panel2 = new JPanel();

                  JOptionPane.showMessageDialog( panel2, e, "Error",
                              JOptionPane.ERROR_MESSAGE );
            }

      }

Open in new window

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
girionis

This is a different question. Please accept an answer and post a new question for this.