import Anweisungen unter Netbeans

andy_a1962

Mitglied
Hallo zusammen,
ich bin ein Netbeans Anfänger und habe noch ein paar Probleme mit der IDE.
1. Wo schreibt NetBeans die import Anweisungen hin. Im Quellcode meiner Anweisung finde ich sie nicht.
Wenn ich eine hinzufügen möchte, bekomme ich die Antwort "unötige Deklaration".
2. Ich möchte Beispielsweise die Eingabe eines TextField mit parseInt() in integer umwandeln. Dabei wird mir immer die parseInt() Methode mit "can not find" reklamiert.
Gruß Andy
 

eRaaaa

Top Contributor
Klassen aus java.lang musst du ja auch nicht importieren. Und bei 2.) : wie benutzt du die Methode denn? Zeige mal ein bisschen Code!
 

andy_a1962

Mitglied
Hallo,

warum muß man für java.lang keine import Anweisung schreiben???

Hier der verwendete Code.

Java:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Zuschnitt.java
 *
 * Created on 05.05.2010, 22:37:11
 */


package zuschnitt;

/**
 *
 * @author Andy
 */
import java.lang.Integer;

public class Zuschnitt extends javax.swing.JFrame {

    /** Creates new form Zuschnitt */
    public Zuschnitt() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jDialog1 = new javax.swing.JDialog();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();

        jDialog1.setTitle("Plattenmaße"); // NOI18N
        jDialog1.setName("jDialog1"); // NOI18N

        jTextField1.setName("jTextField1"); // NOI18N

        jTextField2.setName("jTextField2"); // NOI18N

        jLabel1.setText("Länge");
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText("Breite");
        jLabel2.setName("jLabel2"); // NOI18N

        jButton1.setText("jButton1");
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
        jDialog1.getContentPane().setLayout(jDialog1Layout);
        jDialog1Layout.setHorizontalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDialog1Layout.createSequentialGroup()
                        .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addGap(36, 36, 36)
                        .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField1)
                            .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE))))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        jDialog1Layout.setVerticalGroup(
            jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialog1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addContainerGap(27, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText("Eingaben");
        jMenu1.setName("jMenu1"); // NOI18N

        jMenuItem1.setText("Plattenmaße");
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem2.setText("Teilemaße");
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        jMenu1.add(jMenuItem2);

        jMenuItem3.setText("Anzahl");
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        jMenu1.add(jMenuItem3);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Berechnung");
        jMenu2.setName("jMenu2"); // NOI18N

        jMenuItem4.setText("Berechnung X-Y");
        jMenuItem4.setName("jMenuItem4"); // NOI18N
        jMenu2.add(jMenuItem4);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 279, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>                        

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {       

        //***************************************************                          
        int xx = parseInt(jTextField1.getText());           // FEHLER parseInt()
        //***************************************************
        System.out.println(jTextField1.getText());
        System.out.println(jTextField2.getText());
    }                                        

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        jDialog1.setBounds(400, 400, 200, 200);
        jDialog1.setVisible(true);
    }                                          

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Zuschnitt().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton jButton1;
    private javax.swing.JDialog jDialog1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration                   

}
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
M import org.bukkit.plugin.java.JavaPlugin; funktioniert nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
J Java-File Import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
J Eclipse Trotz .jar-Datei im Classpath Fehler bei import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Z API hinzugefügt jedoch kein Import möglich. IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
OSchriever Eclipse Eclipse - Automatischer import von Klassen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
B IDEA IntelliJ Import Gradle: Plötzlich Android Projekt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
M gradle import in eclipse schlägt fehl IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
M Eclipse import eines maven projects "missing artifact" IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
T Eclipse Import Wizard: Text Datei verarbeiten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
A eclipse: AndEnginePhysicsBox2DExtension: Fehler bei import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
S Geany mit Auto-Import ? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
Y (NetBeans JSP) Findet @page import="org.apache.commons.fileupload.* nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
N Netbeans import/export IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
K Eclipse Android SKD nach lib-import-Versucht zerschossen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
L Eclipse Import von Library IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
J Eclipse Automatischer Import (wie java.lang) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
L javafx import in NetBeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
N NetBeans Import eines Projektes IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
J Eclipse Checkout/Import Maven Projekt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
F Eclipse import J2EE IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
F Eclipse: Import Vorschlag unsichtbar? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
B Eclipse import java. dann kommt kein Fenster IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
H Eclipse import pakckages werden nicht gefunden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Q NetBeans GUI import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
Sonecc Eclipse: File System import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
M eclipse sound datei import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
T Subversive erkennt Projekt nicht mehr nach Import via Ant IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 14
G Eclipse - org.apache.commons import klappt nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P Import aus anderen Projects IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
L Eclipse: import java.io.* anstatt import java.io.File, ... IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
G netbeans - import IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
T Eclipse 3.2 mag mich net (import problem) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
T Problem beim Import von Projekt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
C [Netbeans 4.1] import assistenz? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
J Netbeans 14 friert unter Linus Mint 21 prötzlich ein IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
windl Probleme mit Eclipse unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
B IDEA IntelliJ Flatpak unter Fedora 31 nodejs Zugriff IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
J NetBeans gradle Projekt, unter neu keine Auswahl JavaFX IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
J Unter OS X: Javadoc generieren (wie???) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
K IntelliJ unter Linux: Probleme beim Ausführen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
P Eclipse Eclipse-Problem unter Debian IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 0
K Android Studio unter Mint installieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
I Eclipse Tastenkürzel unter Linux: STRG+SHIFT+U IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
ruutaiokwu zugriff auf die freigabe mit dem svn-repo scheitert unter eclipse / linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 13
M Subversion SSO unter Linux? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
Guybrush Threepwood Jar-Export unter Netbeans (vs. Eclipse) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
W Remote Glassfish 3.1 unter NetBeans 6.9.1 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
C Java Editor empfohlener editor unter linux (ubuntu 10) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 13
ruutaiokwu eclipse unter linux mit openjdk 6 ??? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 18
ruutaiokwu projektspezifischer filter unter eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
D Wie kann ich C++ unter/in NetBeans 6.9 einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
G .eclipse-Verzeichnis unter Windows 7 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
Ebenius JComboBox unter Linux debuggen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
U Problem unter Netbeans 6.8 bei Farben IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S eclipse unter Win 7 (x64) IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
S Shutdownhooks unter Eclipse-Debug IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
G Eclipse unter Ubuntu --- Problem mit deutschen Buchstaben IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
hdi Java-Doc unter Eclipse anzeigen lassen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
T netbeans ide unter lenny startet nicht korrekt IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 8
T Probleme mit @Override unter eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 13
G TPTP unter Eclipse einrichten IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
G Eclipse mit Visual Editor unter Mac OS IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
G Java API unter Eclipse? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
D Problem mit Freedesign unter NetBeans IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
V Fehler bei Netbeans-Installation unter Debian IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
M Grafischer SVN Client unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 10
M Warum läuft Tomcat unter Eclipse nur eingeschränkt? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
K Eclipse unter Windows und unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 20
M Eclipse unter Linux - Performance IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
M Unter Netbeans vollständige Programm zur Weitergabe erzeugen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G Editor/Compiler unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
W Eclipse unter Linux + Sonderzeichen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
H java.library.path unter Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1
G Applikation ausführen unter Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
J [Eclipse] Build Path: Ext. Lib unter JRE, wie rausbekommen? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
DEvent UML2 - Tool unter Eclipse installieren IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 9
S Packege unter Eclipse und jBuilder IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
S Visual Editor Plug-In unter Eclipse installieren, wie? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 7
S Eclipse 3.2 unter Suse Linux 10.1 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 17
O Tomcat 5 unter Eclipse 2.1.2 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
P Neue Packages erstellen unter Eclipse/Tomcat IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
S CVS mit Eclipse unter Windows IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 12
G Probleme mit Eclipse unter Suse 9.3 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
R screenhandling-problem unter eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 6
E Jdom unter eclipse? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
A NetBeans Methoden unter Schloss IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
B Eclipse startet unter Linux nicht IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
P "Run" Shortcut unter Eclipse 3.0 IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
R Wie erstellt man JAR-Dateien unter JBuilder 2005 Foundation? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G Generic Java unter JBuilderX ? IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
K jar Dateien unter Netbeans anlegen IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G Libraries unter JBuilder X IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 5
H Probleme mit dem VE unter Eclipse IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
S Eclipse: dylib unter Mac OS X einbinden IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 4
C Eclipse: Problem mit Slime unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 3
I JBuilderX unter Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
B CVS unter Windows IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
G JBuilder unter Debian Linux IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
H eclipse installation unter freeBSD IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 2
H JVM terminated exit code 1 unter Windows XP Home IDEs - Eclipse, IntelliJ IDEA, BlueJ & mehr 1

Ähnliche Java Themen

Neue Themen


Oben