-
Guten Morgen, alle
Ich wollte gleich ein Programm als Java-Application in Eclipse ausführen, aber ich weiß nicht, welchen Typ ich auswählen sollte, kann mir jemand helfen danke !
http://imageshack.us/photo/my-images/685/appib.jpg

MFG
-
11.10.11 10:46 #2
- Registriert seit
- Oct 2011
- Beiträge
- 1
Guten Morgen Honow,
wenn dein Programm als Java Application laufen soll, solltest du "Reiter Run – Run As – Java
Application" nehmen. Denn ein Java-Applet ist ein eig ein Programm für den Web-Browser.
Hoffe ich habe geholfen
MFG
-
11.10.11 10:57 #3SE Tutorials.de Gastzugang
Lade bitte deine Screen-Shots demnächst über die Anhangs-Funktion hier dierekt im Forum hoch.
Das Problem mit Fremdhostern ist das die Bilder irgendwann gelöscht werden und später niemand mehr Zugriff darauf hat.
Ich habe das mal für dich erledigt.
-
Hallo, Schinni999
Danke erstmal für deine Antwort, ich hab es als java application durchlaufen lassen, aber mir wurde gefragt, welchen Typ von Application ich auswählen sollte ...wie mach ich weiter ?
Danke, MFG
-
11.10.11 11:19 #5
Hi,
also so wie es dir Schinni999 beschrieben hat funktioniert das schon. Wenn du "Reiter Run – Run As – Java
Application" ausgewählt und gedrückt hast, wird deine Application ausgeführt.
Damit dein Programm gestartet werden kann, muss dieses eine main-Methode enthalten!
Ohne die funktioniert das sonst nicht, da das der Einstiegspunkt in ein Programm ist.Code java:1 2 3
public static void main(String[] args) { }
Gruß
FabioBitte die Code-Tags verwenden. Bei Java-Code: [java]...[/java]
Tutorials:
Automatisches erzeugen eines Inhaltsverzeichnisses (Javascript)
JAnimationPanel - Animationen für Swing/AWT
SWTRatingBar (Bewertungs-Composite) selbst programmieren
____________________________________________________________________________
Über eine Bewertung (Stern links unter dem Beitrag) oder ein Danke freue ich mich sehr.
-
Danke euch, es hat geklappt

Nun jetzt hab ich nach dem Ausführen noch ne Fehlermeldung bekommen, wie sollte ich das Problem beheben ? Danke !
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Datei '(unbekannt)' nicht gefunden.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3072)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)
at de.iph.EasyFunCalc.database.Database.<init>(Database.java:25)
at de.iph.EasyFunCalc.database.Database.getInstance(Database.java:20)
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.update(CustomerPanel.java:102)
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.<init>(CustomerPanel.java:74)
at de.iph.EasyFunCalc.gui.maintenance.Maintenance.<init>(Maintenance.java:31)
at de.iph.EasyFunCalc.gui.GUI.<init>(GUI.java:56)
at de.iph.EasyFunCalc.gui.GUI.main(GUI.java:137)Geändert von sheel (11.10.11 um 11:56 Uhr) Grund: Doppel
-
11.10.11 12:11 #7
Das hilft uns so überhaupt nicht weiter. Du musst auch den relevanten Code preisgeben. Sonst können wir auch nur raten.
Bitte die Code-Tags verwenden. Bei Java-Code: [java]...[/java]
Tutorials:
Automatisches erzeugen eines Inhaltsverzeichnisses (Javascript)
JAnimationPanel - Animationen für Swing/AWT
SWTRatingBar (Bewertungs-Composite) selbst programmieren
____________________________________________________________________________
Über eine Bewertung (Stern links unter dem Beitrag) oder ein Danke freue ich mich sehr.
-
Eclipse zeigte mir nur den einzigen Fehler, aber ich glaube ich hab die Datenbank schon in den ODBC-Quellen eingetragen..weiß gerade nicht warum ..
-
11.10.11 12:31 #9
Wie schon gesagt, ohne Code können wir dir nicht helfen...
Bitte die Code-Tags verwenden. Bei Java-Code: [java]...[/java]
Tutorials:
Automatisches erzeugen eines Inhaltsverzeichnisses (Javascript)
JAnimationPanel - Animationen für Swing/AWT
SWTRatingBar (Bewertungs-Composite) selbst programmieren
____________________________________________________________________________
Über eine Bewertung (Stern links unter dem Beitrag) oder ein Danke freue ich mich sehr.
-
ah, sorry ich füge gleich hier die Code hinzu..
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)
for(DriverInfo aDriver : registeredDrivers) {
// If the caller does not have permission to load the driver then
// skip it.
if(isDriverAllowed(aDriver.driver, callerCL)) {
try {
println(" trying " + aDriver.driver.getClass().getName());
Connection con = aDriver.driver.connect(url, info);
if (con != null) {
// Success!
println("getConnection returning " + aDriver.driver.getClass().getName());
return (con);
}
} catch (SQLException ex) {
if (reason == null) {
reason = ex;
}
}
} else {
println(" skipping: " + aDriver.getClass().getName());
}
public static Connection getConnection(String url)
throws SQLException {
java.util.Properties info = new java.util.Properties();
// Gets the classloader of the code that called this method, may
// be null.
ClassLoader callerCL = DriverManager.getCallerClassLoader();
return (getConnection(url, info, callerCL));
}
at de.iph.EasyFunCalc.database.Database.<init>(Database.java:25)
at de.iph.EasyFunCalc.database.Database.getInstance(Database.java:20)private Connection connection;
private boolean locked = false;
private boolean closeWhenUnlock = false;
public static synchronized Database getInstance() throws SQLException {
if(instance == null) instance = new Database();
return instance;
}
private Database() throws SQLException {
connection = DriverManager.getConnection(CONN_STRING);
StatusBar.getInstance().setText(3, "Datenbank verbunden");
}
public PreparedStatement prepareStatement(String sql) throws SQLException {
return connection.prepareStatement(sql);
}
public void close() throws SQLException {
if(!locked) {
connection.close();
instance = null;
} else closeWhenUnlock = true;
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.update(CustomerPanel.java:102)public static synchronized Database getInstance() throws SQLException {
if(instance == null) instance = new Database();
return instance;
}
private Database() throws SQLException {
connection = DriverManager.getConnection(CONN_STRING);
StatusBar.getInstance().setText(3, "Datenbank verbunden");
}
public void update(int selectID) throws SQLException {
if(parent != null) this.project = parent.getProject();
listModel.removeAllElements();
Customer select = null;
for(Customer customer: Database.getInstance().getCustomers()) {
listModel.addElement(customer);
if(customer.getDatabaseID() == selectID) select = customer;
}
getList().setSelectedValue(select, true);
getList().repaint();
if(select == null) getSelectButton().setEnabled(false);
}
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.<init>(CustomerPanel.java:74)
public CustomerPanel(Maintenance parent) throws SQLException {
this.parent = parent;
nameField = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD);
nameField.addKeyListener(getKeyListener());
contactPersonField = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD);
contactPersonField.addKeyListener(getKeyListener());
adress1Field = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD);
adress1Field.addKeyListener(getKeyListener());
adress2Field = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD);
adress2Field.addKeyListener(getKeyListener());
this.setPreferredSize(new Dimension(360, 210));
this.setBorder(BorderFactory.createTitledBorder("Kunde"));
this.setLayout(new BorderLayout());
this.add(getButtonPanel(), BorderLayout.NORTH);
JScrollPane scrollPane = new JScrollPane(getList());
scrollPane.setPreferredSize(GUI.LIST);
this.add(scrollPane, BorderLayout.LINE_START);
this.add(getCenterPanel(), BorderLayout.CENTER);
getSaveButton().setEnabled(false);
getDeleteButton().setEnabled(false);
update(0);
}
at de.iph.EasyFunCalc.gui.maintenance.Maintenance.<init>(Maintenance.java:31)
at de.iph.EasyFunCalc.gui.GUI.<init>(GUI.java:56)public Maintenance(GUI gui) throws SQLException {
this.gui = gui;
detailsPanel = new DetailsPanel(this);
customerPanel = new CustomerPanel(this);
assemblyPanel = new AssemblyPanel(this);
processPanel = new ProcessPanel(this);
partPanel = new PartPanel(this);
attributePanel = new AttributePanel(this);
functionPanel = new FunctionPanel(this);
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel firstPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
firstPanel.add(detailsPanel);
firstPanel.add(customerPanel);
this.add(firstPanel);
at de.iph.EasyFunCalc.gui.GUI.main(GUI.java:137)navigationPanel = new NavigationPanel(this);
welcomePanel = navigationPanel.getWelcomePanel();
try {
projectPanel = new ProjectPanel(this);
maintenance = new Maintenance(this);
overview = new Overview(this);
calculation = new Calculation();
} catch (SQLException exception) {
MessageHandler.getInstance().showException(exception);
System.exit(0);
}
Oder sollte ich Bilder machen ****?public void windowClosing(WindowEvent event) {
dispose();
}
public void windowDeactivated(WindowEvent event) {}
public void windowDeiconified(WindowEvent event) {}
public void windowIconified(WindowEvent event) {}
public void windowOpened(WindowEvent event) {}
public static void main(String[] args) {
GUI gui = new GUI();
gui.setVisible(true);
}
Danke sehr !! MFG
-
11.10.11 12:50 #11
Bitte verwende die Java-Codetags. Da da der Code gehighlighted wird.
Bitte die Code-Tags verwenden. Bei Java-Code: [java]...[/java]
Tutorials:
Automatisches erzeugen eines Inhaltsverzeichnisses (Javascript)
JAnimationPanel - Animationen für Swing/AWT
SWTRatingBar (Bewertungs-Composite) selbst programmieren
____________________________________________________________________________
Über eine Bewertung (Stern links unter dem Beitrag) oder ein Danke freue ich mich sehr.
-
Ok, sorry nochmal
at java.sql.DriverManager.getConnection(DriverManager.java:579)
-> Fehler : Connection con = aDriver.driver.connect(url, info);
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
SQLException reason = null; for(DriverInfo aDriver : registeredDrivers) { // If the caller does not have permission to load the driver then // skip it. if(isDriverAllowed(aDriver.driver, callerCL)) { try { println(" trying " + aDriver.driver.getClass().getName()); Connection con = aDriver.driver.connect(url, info); if (con != null) { // Success! println("getConnection returning " + aDriver.driver.getClass().getName()); return (con); } } catch (SQLException ex) { if (reason == null) { reason = ex; } }
at java.sql.DriverManager.getConnection(DriverManager.java:243)
Fehler: Connection con = aDriver.driver.connect(url, info);
Code java:1 2 3 4 5 6 7 8 9 10 11
public static Connection getConnection(String url) throws SQLException { java.util.Properties info = new java.util.Properties(); // Gets the classloader of the code that called this method, may // be null. ClassLoader callerCL = DriverManager.getCallerClassLoader(); return (getConnection(url, info, callerCL)); }
at de.iph.EasyFunCalc.database.Database.<init>(Database.java:25)
Fehler: connection = DriverManager.getConnection(CONN_STRING);
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
public static synchronized Database getInstance() throws SQLException { if(instance == null) instance = new Database(); return instance; } private Database() throws SQLException { connection = DriverManager.getConnection(CONN_STRING); StatusBar.getInstance().setText(3, "Datenbank verbunden"); } public PreparedStatement prepareStatement(String sql) throws SQLException { return connection.prepareStatement(sql); } public void close() throws SQLException { if(!locked) { connection.close(); instance = null; } else closeWhenUnlock = true; }
at de.iph.EasyFunCalc.database.Database.getInstance(Database.java:20)
Fehler: if(instance == null) instance = new Database();
Code java:1 2 3 4 5 6 7 8 9 10 11 12
private boolean locked = false; private boolean closeWhenUnlock = false; public static synchronized Database getInstance() throws SQLException { if(instance == null) instance = new Database(); return instance; } private Database() throws SQLException { connection = DriverManager.getConnection(CONN_STRING); StatusBar.getInstance().setText(3, "Datenbank verbunden"); }
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.update(CustomerPanel.java:102)
Fehler: for(Customer customer: Database.getInstance().getCustomers()) {
Code java:1 2 3 4 5 6 7 8 9 10 11 12
public void update(int selectID) throws SQLException { if(parent != null) this.project = parent.getProject(); listModel.removeAllElements(); Customer select = null; for(Customer customer: Database.getInstance().getCustomers()) { listModel.addElement(customer); if(customer.getDatabaseID() == selectID) select = customer; } getList().setSelectedValue(select, true); getList().repaint(); if(select == null) getSelectButton().setEnabled(false); }
at de.iph.EasyFunCalc.gui.maintenance.CustomerPanel.<init>(CustomerPanel.java:74)
Fehler: update(0);
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
public CustomerPanel(Maintenance parent) throws SQLException { this.parent = parent; nameField = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD); nameField.addKeyListener(getKeyListener()); contactPersonField = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD); contactPersonField.addKeyListener(getKeyListener()); adress1Field = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD); adress1Field.addKeyListener(getKeyListener()); adress2Field = new LimitedTextField(GUI.MAX_LABEL_LENGTH, GUI.FIELD); adress2Field.addKeyListener(getKeyListener()); this.setPreferredSize(new Dimension(360, 210)); this.setBorder(BorderFactory.createTitledBorder("Kunde")); this.setLayout(new BorderLayout()); this.add(getButtonPanel(), BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(getList()); scrollPane.setPreferredSize(GUI.LIST); this.add(scrollPane, BorderLayout.LINE_START); this.add(getCenterPanel(), BorderLayout.CENTER); getSaveButton().setEnabled(false); getDeleteButton().setEnabled(false); update(0); }
at de.iph.EasyFunCalc.gui.maintenance.Maintenance.<init>(Maintenance.java:31)
Fehler: customerPanel = new CustomerPanel(this);
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
public Maintenance(GUI gui) throws SQLException { this.gui = gui; detailsPanel = new DetailsPanel(this); customerPanel = new CustomerPanel(this); assemblyPanel = new AssemblyPanel(this); processPanel = new ProcessPanel(this); partPanel = new PartPanel(this); attributePanel = new AttributePanel(this); functionPanel = new FunctionPanel(this); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel firstPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); firstPanel.add(detailsPanel); firstPanel.add(customerPanel); this.add(firstPanel); JPanel secondPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); secondPanel.add(processPanel); secondPanel.add(assemblyPanel); secondPanel.add(partPanel); this.add(secondPanel);
at de.iph.EasyFunCalc.gui.GUI.<init>(GUI.java:56)
Fehler: maintenance = new Maintenance(this);
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
public GUI() { super("EasyFunCalc"); this.setMinimumSize(new Dimension(1200, 900)); this.setLocationRelativeTo(null); this.addWindowListener(this); this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(GUI.IMG_PATH + "logo.png"))); navigationPanel = new NavigationPanel(this); welcomePanel = navigationPanel.getWelcomePanel(); try { projectPanel = new ProjectPanel(this); maintenance = new Maintenance(this); overview = new Overview(this); calculation = new Calculation(); } catch (SQLException exception) { MessageHandler.getInstance().showException(exception); System.exit(0); } this.setLayout(new CardLayout()); this.add(welcomePanel, WELCOME); this.add(getContentPanel(), CONTENT); MessageHandler.getInstance().setParent(this);
at de.iph.EasyFunCalc.gui.GUI.main(GUI.java:137)
Fehler: GUI gui = new GUI();
Code java:1 2 3 4 5 6 7 8 9 10 11 12 13 14
public void windowClosing(WindowEvent event) { dispose(); } public void windowDeactivated(WindowEvent event) {} public void windowDeiconified(WindowEvent event) {} public void windowIconified(WindowEvent event) {} public void windowOpened(WindowEvent event) {} public static void main(String[] args) { GUI gui = new GUI(); gui.setVisible(true); } }
Danke sehr !Geändert von hanow (11.10.11 um 13:07 Uhr)
-
11.10.11 13:16 #13
- Registriert seit
- Jun 2005
- Beiträge
- 8.168
If at first you don't succeed, try again. Then quit. No use being a damn fool about it.
-
Danke, ich brauch Vorschlag, wie kann ich am besten das Problem beheben ?
MFG
-
11.10.11 13:50 #15
- Registriert seit
- Jun 2005
- Beiträge
- 8.168
If at first you don't succeed, try again. Then quit. No use being a damn fool about it.
Ähnliche Themen
-
Frage zum Aufbau eines Programms
Von headbanger82 im Forum JavaAntworten: 0Letzter Beitrag: 11.06.07, 00:03 -
Hab eine Frage bezüglich eines C++ Programms
Von Astror Enales im Forum C/C++Antworten: 2Letzter Beitrag: 13.07.06, 14:40 -
Sterbeaktion eines Programms
Von Unicate im Forum C/C++Antworten: 4Letzter Beitrag: 16.05.06, 21:52 -
Testen eines RMI + DB Programms
Von gerritka im Forum JavaAntworten: 0Letzter Beitrag: 30.06.05, 16:16 -
Ausfürhung eines Programms
Von Sc0rp!0n im Forum C/C++Antworten: 4Letzter Beitrag: 25.04.02, 23:42



5Danke

Zitieren

Login





