3 kleine Probleme...

chewee

Mitglied
Hallo Community,

als erstes... ich bin ein blutiger Anfänger...

Denoch habe ich mir ein kleines Programm geschrieben mit dem ich mir die Windows iso´s vom Server laden kann.
Dazu soll eine Progressbar den Fortschritt zeigen.
Das klappt auch soweit alles...

das erste Problem ist das das Fenster einfriert sobald ich den Download starte und wenn er fertig ist, ist wieder alles okay.

Als nächstes will ich eine Funktion einbauen mit der ich einen USB-Stick auswählen kann.
Dann möchte den Stick mit Diskpart vorbereiten... und damit den Stick Bootfähig machen...

das dritte Problem ist wenn ich das Programm starte ist es für einen kurzen Moment schwarz und dann erscheinen erst die Elemente wie textfield und so...

Soviel zur Problematik...

Ich denke das mit dem freez und dem schwarzen am Anfang sollte schnell behoben sein...
Allerdings weiß ich nicht so recht ob das mit dem USB-Stick und Diskpart mit Java möglich ist.
 

Highchiller

Bekanntes Mitglied
Naja ganz so ein blutiger Anfänger kannst du ja nicht sein :p

1) Freeze
Da wir deinen Code nicht kennen kann ich auch erst mal nur spekulieren woher deine Fehler kommen. Dass der Bildschirm einfriert liegt mit sicherheit daran, dass du keinen extra Thread benutzt hast. Dann berechnet dein Programm sequentiell alles durch und ganz am Ende wartet die GUI auf die Rechenzeit zum Aktualisieren. Da ist aber schon alles vorbei, folglich "freezed" die GUI einfach ein.

Wie schon erwähnt, einfach dein Berechnungscode auslagern und als eigenständigen Thread starten, der dann parallel läuft. Das sollte das Problem beheben.

2) Schwarzer Bildschirm
Das klingt danach, als wenn du erst irgendwo deinen Frame auf setVisible(true) setzt und erst danach deine Elemente hinzufügst. Auf die Art zeichnet er erst dein leeren Frame und fügt erst im Nachhinein deine Elemente hinzu.
Also erst ganz am Ende, nachdem dein Frame vollständig gefüllt ist rufst du noch setVisible(true); auf. Das sollte das Problem lösen.

3) USB
Wenn du USB-Sticks mit Java zugreifen willst musst du dir die Libraries dazu besorgen. Zum Beispiel usb4java mit javax.usb.
Wenn du das ganze aber sowieso von Diskpart lösen lassen willst, kannst du in Java auch andere Prozesse starten. Dafür benutzt du den ProcessBuilder.
 

chewee

Mitglied
Hey danke für die schnelle Antwort...

Also das mit dem setVisible ans ende setzten hat wunderbar geklappt:D

Leider verstehe ich das mit dem Auslagern nicht ganz...


deshab hier mal mein code:

Java:
import java.awt.Choice;
import java.awt.FileDialog;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.*;

public class DLgui {
	static JFrame frm = new JFrame("Windows 7 & 8.1 Downloader");
	static Choice cho = new Choice();
	static Choice cho1 = new Choice();
	static Label label = new Label("OS Auswahl:");
	static Label label1 = new Label("USB-Stick Auswählen:");
	static JButton dow = new JButton("Download");
	static JButton dowa = new JButton(" Download abbrechen");
	static JButton abb = new JButton("Abbruch");
	static JButton usb = new JButton("USB-Medium erstellen...");
	static JProgressBar jpb = new JProgressBar(0, 100);
	static String filename, site;
	
	public static void main(String[] args) throws IOException {

		
		frm.setBounds(50, 50, 415, 320);
		frm.setLayout(null);
		frm.setResizable(false);
		frm.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
					frm.dispose();
					System.exit(0);				
		}});
		jpb.setValue(0);
        jpb.setMaximum(100);
        jpb.setStringPainted(true); 
		cho.insert("Windows 7 Home Premium 32Bit", 0);
		cho.insert("Windows 7 Home Premium N 32Bit",1);
		cho.insert("Windows 7 Home Premium 64Bit",2);
		cho.insert("Windows 7 Professional 32Bit",3);
		cho.insert("Windows 7 Professional N 32Bit",4);
		cho.insert("Windows 7 Professional 64Bit",5);
		cho.insert("Windows 8.1 32Bit",6);
		cho.insert("Windows 8.1 64Bit",7);
	
		label.setFont(new Font("Arial", Font.BOLD, 12));
		label.setBounds(25, 60, 100, 30);
		frm.add(label);
		cho.setBounds(135, 63, 250, 30);
		frm.add(cho);
		dow.setBounds(25, 100, 90, 30);
		frm.add(dow);
		dowa.setBounds(120, 100, 160, 30);
		frm.add(dowa);
		abb.setBounds(285, 100, 100, 30);
		frm.add(abb);
		usb.setBounds(25, 150, 360, 30);
		frm.add(usb);
		jpb.setBounds(25, 240, 360, 30);
		frm.add(jpb);
		frm.setVisible(true);
		dow.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			 cho.getSelectedItem();
				if(cho.getSelectedIndex() == 0){
			        site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65740/X15-65740.iso";
			        filename = "C:\\Windows\\Temp\\Win7_Home_Premium_32.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2463242240.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
				  }
				if(cho.getSelectedIndex() == 1 ){  
					site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X16-13473/X16-13473.iso";
			        filename="C:\\Windows\\Temp\\Win7_Home_Premium_32(N).iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2184001536.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
					}
				if(cho.getSelectedIndex() == 2 ){
					site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65741/X15-65741.iso";
			        filename="C:\\Windows\\Temp\\Win7_Home_Premium_64.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 3192264704.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
					  
					}
				if(cho.getSelectedIndex() == 3 ){
					site = "http://msft.digitalrivercontent.net/win/X17-59886.iso";
			        filename="C:\\Windows\\Temp\\Win7_Professional_32.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2463242240.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
					}
				if(cho.getSelectedIndex() == 4 ){
					site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X16-13564/X16-13564.iso";
			        filename="C:\\Windows\\Temp\\Win7_Professional(N)_32.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2184001536.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
						}
				if(cho.getSelectedIndex() == 5 ){
					site = "http://msft.digitalrivercontent.net/win/X17-59885.iso";
			        filename="C:\\Windows\\Temp\\Win7_Professional_64.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 3192264704.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
					}
				if(cho.getSelectedIndex() == 6 ){
					site = "http://care.dlservice.microsoft.com/dl/download/1/B/E/1BEDF444-0504-4694-A738-4005AAD16887/9600.16384.WINBLUE_RTM.130821-1623_X86FRE_ENTERPRISE_EVAL_DE-DE-IRM_CENA_X86FREE_DE-DE_DV5.ISO";
			        filename="C:\\Windows\\Temp\\Win8.1_32.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			            java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2463242240.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
					}
				if(cho.getSelectedIndex() == 7 ){
					site = "http://care.dlservice.microsoft.com/dl/download/1/B/E/1BEDF444-0504-4694-A738-4005AAD16887/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_DE-DE-IRM_CENA_X64FREE_DE-DE_DV5.ISO";
			        filename="C:\\Windows\\Temp\\Win8.1_64.iso";
			        URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
						java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						} java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			            byte[] data = new byte[1024];
			            int i=0;
			            try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2463242240.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
				    }			
			}
		});
		abb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frm.dispose();
				System.exit(0);
			}
		});
		usb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				label1.setFont(new Font("Arial", Font.BOLD, 12));
				label1.setBounds(25, 190, 130, 30);
				frm.add(label1);
				cho1.setBounds(175, 193, 210, 30);
				frm.add(cho1);

			}
		});
		

}}
 

Highchiller

Bekanntes Mitglied
Großer Gott, da wurde auf alle erdenklichen Konventionen geschissen XD
Immerhin hast du brav eingerückt :p

Also mit auslagern meinte ich (und das hast du jetzt sogar noch viel nötiger als ich eigentlich dachte), dass du daraus eine eigene Klasse machst. Die Grundlagen dafür kannst du dir ganz schnell aneignen. Ich empfehle dir mal Nach "Java Insel" zu googlen.

Stichwort: Klassen, Methoden
Davon brauchste erst mal ne Menge. Dann kann man den Code auch lesen und dir eher helfen.

Und ehe du das nicht hast machts wohl auch nicht viel Sinn dir zu erklären wie ein Thread funktioniert. Dafür fehlen dir einfach die Grundlagen.
 

chewee

Mitglied
ich sag ja ... blutiger Anfänger :D
und das einrücken macht ja eclipse alles :toll:
soll ich dafür dann einfach eine neue Klasse erstellen und dann darauf quasi verweisen?
 

Highchiller

Bekanntes Mitglied
Da besteht viel nachholbedarf...

Erst mal solltest du in der main-Methode nichts machen als ein Objekt deiner Klasse zu erstellen. Die erbt dann vom JFrame und wird in der Main als Objekt erzeugt.
Dann erhält deine Klasse schon mal eine Methode für diese ganzen If-Cases. Die scheinen mir extremst ähnlich zu sein (hab nich genau nachgeschaut). Also machst du daraus eine Methode und rufst die Methode entsprechend auf. Noch eleganter wirds wenn du statt 10-mal if einfach Switch-Case verwendest.

Wenn du das alles hast kannst du dir eine 2. Klasse fast sparen. Dann musst du das was in der Methode aufgerufen wird (denn das dauert ja so lange) als eigenen Thread starten, damit dein Programm eben parallel und nicht sequentiell läuft.

Dann friert deine GUI auch nich mehr ein...

UND DAAAAAANNNN kannst du dich an USB versuchen XD
 

chewee

Mitglied
UND DAAAAAANNNN kannst du dich an USB versuchen XD

so wollte ich das auch machen :D erstmal den rest zum laufen kriegen und denn das mit dem stick.
Denn das scheint mir noch mal ne dicke Hausnummer zu sein:rtfm:



sorry für die noob fragen aber
ein Objekt meiner Klasse erstellen bedeutet dann also nur die gui
und den rest in einer neuen klasse?
 

Highchiller

Bekanntes Mitglied
Du kannst ja deine Klasse direkt benutzen. Also musst du eigentlich keine ganz neue schreiben.

Java:
public class DLgui extends JFrame {
    // nu die ganzen variablen, die müssen jetzt nicht mehr static sein

   private DLgui(){
      // hier wird dein objekt/klasse erstellt. also einfach setBounds und so weiter
   }

   // hier ein paar methoden falls nötig

   public static void main (String[] args){
      // nu erstellst du dein objekt
      DLgui meinFenster = new DLgui();
      meinFenster.setVisible(true);
   }
}
 
Zuletzt bearbeitet:

chewee

Mitglied
EDIT:

Hab den Fehler selber gefunden...
Lag daran das ich die Thead Variablen einmal static hatte und einmal local...

Als nächstes wage ich mich an die USB Baustelle ;)
Ich melde mich bestimmt nochmal ;)

Soooo ich hab das jetzt mal alles so umgebaut wie ich das verstanden habe...

leider funktioniert das nicht ganz ...
also er startet den Thread nicht und verweißt im Debugger auf die Zeile zero.start();

Und das ich für die if() dinge ne Methode erstellen soll verstehe ich noch nicht wirklich...
Ja die sind fast gleich ... allerdings sind da die verschiedenen Links und der Speicherort bzw Name der Datei drin...
Muss ich da dann 8 Methoden erstellen oder klappt das auch irgendwie mit Variablen?


Java:
import java.awt.Choice;
import java.awt.FileDialog;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import javax.swing.*;


@SuppressWarnings("serial")
public class DLgui extends JFrame{
    // nu die ganzen variablen, die müssen jetzt nicht mehr static sein
	JFrame frm = new JFrame("Windows 7 & 8.1 Downloader");
	static Choice cho = new Choice();
	static Choice cho1 = new Choice();
	Label label = new Label("OS Auswahl:");
	Label label1 = new Label("USB-Stick Auswählen:");
	JButton dow = new JButton("Download");
	JButton dowa = new JButton(" Download abbrechen");
	JButton abb = new JButton("Abbruch");
	JButton usb = new JButton("USB-Medium erstellen...");
	JButton image = new JButton("Image auswählen...");
	JButton start = new JButton("...& erstellen");
	static JProgressBar jpb = new JProgressBar(0, 100);
	String filename, site;
	Object object = new Object();
	static Thread zero, one, two, three, four, five, six, seven;
	
   private DLgui(){
      // hier wird dein objekt/klasse erstellt. also einfach setBounds und so weiter
	   	frm.setBounds(50, 50, 415, 350);
		frm.setLayout(null);
		frm.setResizable(false);
		frm.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
					frm.dispose();
					System.exit(0);				
		}});
		jpb.setValue(0);
        jpb.setMaximum(100);
        jpb.setStringPainted(true); 
		cho.insert("Windows 7 Home Premium 32Bit", 0);
		cho.insert("Windows 7 Home Premium N 32Bit",1);
		cho.insert("Windows 7 Home Premium 64Bit",2);
		cho.insert("Windows 7 Professional 32Bit",3);
		cho.insert("Windows 7 Professional N 32Bit",4);
		cho.insert("Windows 7 Professional 64Bit",5);
		cho.insert("Windows 8.1 32Bit",6);
		cho.insert("Windows 8.1 64Bit",7);
		
		label.setFont(new Font("Arial", Font.BOLD, 12));
		label.setBounds(25, 60, 100, 30);
		frm.add(label);
		cho.setBounds(135, 63, 250, 30);
		frm.add(cho);
		dow.setBounds(25, 100, 90, 30);
		frm.add(dow);
		dowa.setBounds(120, 100, 160, 30);
		frm.add(dowa);
		abb.setBounds(285, 100, 100, 30);
		frm.add(abb);
		usb.setBounds(25, 150, 360, 30);
		frm.add(usb);
		jpb.setBounds(25, 270, 360, 30);
		frm.add(jpb);
		image.setBounds(25, 230, 175, 30);
		frm.add(image);
		start.setBounds(210, 230, 175, 30);
		frm.add(start);
		frm.setVisible(true);
		
		dow.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			 cho.getSelectedItem();
				
			}
		});
		abb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frm.dispose();
				System.exit(0);
			}
		});
		usb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				label1.setFont(new Font("Arial", Font.BOLD, 12));
				label1.setBounds(25, 190, 130, 30);
				frm.add(label1);
				cho1.setBounds(175, 193, 210, 30);
				frm.add(cho1);
			}
		});
		image.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				FileDialog fd = new FileDialog(new Frame());
				fd.setTitle("USB-Medium auswählen");
				fd.setVisible(true);
				fd.setMode(FileDialog.LOAD);
				object = fd.getFile();
			}
		});
		start.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ProcessBuilder builder = new ProcessBuilder("cmd", "/c", "diskpart", "list disk");			
				try {
					Process p = builder.start();				    
				}
				catch (IOException e1) {
				    e1.printStackTrace();
				}
			}
		});
		Thread zero = new Thread(new Runnable(){
			public void run(){
				  String site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65740/X15-65740.iso";
			      String filename = "C:\\Users\\XC\\Desktop\\Win7_Home_Premium_32.iso";
			      URL url = null;
					try {
						url = new URL(site);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					}HttpURLConnection connection = null;
					try {
						connection = (HttpURLConnection) url.openConnection();
					} catch (IOException e1) {
						e1.printStackTrace();
					}float totalDataRead=0;
			          java.io.BufferedInputStream in = null;
						try {
							in = new java.io.BufferedInputStream(connection.getInputStream());
						} catch (IOException e1) {
							e1.printStackTrace();
						}java.io.FileOutputStream fos = null;
						try {
							fos = new java.io.FileOutputStream(filename);
						} catch (FileNotFoundException e1) {
							e1.printStackTrace();
						}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
			          byte[] data = new byte[1024];
			          int i=0;
			          try {
							while((i=in.read(data,0,1024))>=0){
							float filesize = (float) 2463242240.0;
							totalDataRead=totalDataRead+i;
							bout.write(data,0,i);
							float Percent=(totalDataRead*100)/filesize;
							jpb.setValue((int)Percent);
							}
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							bout.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}try {
							in.close();
						} catch (IOException e1) {
							e1.printStackTrace();
						}
			}
			
		});
		Thread one = new Thread(new Runnable(){
			public void run(){
				String site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X16-13473/X16-13473.iso";
		      String filename = "C:\\Windows\\Temp\\Win7_Home_Premium_32(N).iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 2184001536.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
				}
		});
		Thread two = new Thread(new Runnable(){
			public void run(){
				String site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65741/X15-65741.iso";
		      String filename = "C:\\Windows\\Temp\\Win7_Home_Premium_64.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 3192264704.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
				  
				}
		});
		Thread three = new Thread(new Runnable(){
			public void run(){
				String site = "http://msft.digitalrivercontent.net/win/X17-59886.iso";
		      String filename = "C:\\Windows\\Temp\\Win7_Professional_32.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 2463242240.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
				}
		});
		Thread four = new Thread(new Runnable(){
			public void run(){
				String site = "http://msft-dnl.digitalrivercontent.net/msvista/pub/X16-13564/X16-13564.iso";
		      String filename = "C:\\Windows\\Temp\\Win7_Professional(N)_32.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 2184001536.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
					}
		});
		Thread five = new Thread(new Runnable(){
			public void run(){
				String site = "http://msft.digitalrivercontent.net/win/X17-59885.iso";
		      String filename = "C:\\Windows\\Temp\\Win7_Professional_64.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 3192264704.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
				}
		});
		Thread six = new Thread(new Runnable(){
			public void run(){
				String site = "http://care.dlservice.microsoft.com/dl/download/1/B/E/1BEDF444-0504-4694-A738-4005AAD16887/9600.16384.WINBLUE_RTM.130821-1623_X86FRE_ENTERPRISE_EVAL_DE-DE-IRM_CENA_X86FREE_DE-DE_DV5.ISO";
		      String filename = "C:\\Windows\\Temp\\Win8.1_32.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
		          java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					}java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 2463242240.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
				}
		});
		Thread seven = new Thread(new Runnable(){
			public void run(){
				String site = "http://care.dlservice.microsoft.com/dl/download/1/B/E/1BEDF444-0504-4694-A738-4005AAD16887/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_DE-DE-IRM_CENA_X64FREE_DE-DE_DV5.ISO";
		      String filename = "C:\\Windows\\Temp\\Win8.1_64.iso";
		      URL url = null;
				try {
					url = new URL(site);
				} catch (MalformedURLException e1) {
					e1.printStackTrace();
				}HttpURLConnection connection = null;
				try {
					connection = (HttpURLConnection) url.openConnection();
				} catch (IOException e1) {
					e1.printStackTrace();
				}float totalDataRead=0;
					java.io.BufferedInputStream in = null;
					try {
						in = new java.io.BufferedInputStream(connection.getInputStream());
					} catch (IOException e1) {
						e1.printStackTrace();
					}java.io.FileOutputStream fos = null;
					try {
						fos = new java.io.FileOutputStream(filename);
					} catch (FileNotFoundException e1) {
						e1.printStackTrace();
					} java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
		          byte[] data = new byte[1024];
		          int i=0;
		          try {
						while((i=in.read(data,0,1024))>=0){
						float filesize = (float) 2463242240.0;
						totalDataRead=totalDataRead+i;
						bout.write(data,0,i);
						float Percent=(totalDataRead*100)/filesize;
						jpb.setValue((int)Percent);
						}
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						bout.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}try {
						in.close();
					} catch (IOException e1) {
						e1.printStackTrace();
					}
			    }
		});
		}
	public static void main(String[] args){
		 DLgui meinFenster = new DLgui();
	    //  meinFenster.setVisible(true);
		 if(cho.getSelectedIndex() == 0){
			 zero.start();
		 }


		
			
}}
 
Zuletzt bearbeitet:

Highchiller

Bekanntes Mitglied
Also ein Thread ist eine eigene Klasse. Als Faustregel kannst du dir überlegen, wenn die Klasse länger als 5 Zeilen wird, lager ich sie lieber aus.

Erst mal schaut das schon viel aufgeräumter aus. Was ich aber eigentlich meinte wäre sowas hier:
Java:
import java.awt.Choice;
import java.awt.FileDialog;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import javax.swing.*;

@SuppressWarnings("serial")
public class DLgui extends JFrame {
	// nu die ganzen variablen, die müssen jetzt nicht mehr static sein
	JFrame frm = new JFrame("Windows 7 & 8.1 Downloader");
	static Choice cho = new Choice();
	static Choice cho1 = new Choice();
	Label label = new Label("OS Auswahl:");
	Label label1 = new Label("USB-Stick Auswählen:");
	JButton dow = new JButton("Download");
	JButton dowa = new JButton(" Download abbrechen");
	JButton abb = new JButton("Abbruch");
	JButton usb = new JButton("USB-Medium erstellen...");
	JButton image = new JButton("Image auswählen...");
	JButton start = new JButton("...& erstellen");
	static JProgressBar jpb = new JProgressBar(0, 100);
	String filename, site;
	Object object = new Object();
	static Thread zero, one, two, three, four, five, six, seven;

	private DLgui() {
		// hier wird dein objekt/klasse erstellt. also einfach setBounds und so
		// weiter
		frm.setBounds(50, 50, 415, 350);
		frm.setLayout(null);
		frm.setResizable(false);
		frm.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				frm.dispose();
				System.exit(0);
			}
		});
		jpb.setValue(0);
		jpb.setMaximum(100);
		jpb.setStringPainted(true);
		cho.insert("Windows 7 Home Premium 32Bit", 0);
		cho.insert("Windows 7 Home Premium N 32Bit", 1);
		cho.insert("Windows 7 Home Premium 64Bit", 2);
		cho.insert("Windows 7 Professional 32Bit", 3);
		cho.insert("Windows 7 Professional N 32Bit", 4);
		cho.insert("Windows 7 Professional 64Bit", 5);
		cho.insert("Windows 8.1 32Bit", 6);
		cho.insert("Windows 8.1 64Bit", 7);

		label.setFont(new Font("Arial", Font.BOLD, 12));
		label.setBounds(25, 60, 100, 30);
		frm.add(label);
		cho.setBounds(135, 63, 250, 30);
		frm.add(cho);
		dow.setBounds(25, 100, 90, 30);
		frm.add(dow);
		dowa.setBounds(120, 100, 160, 30);
		frm.add(dowa);
		abb.setBounds(285, 100, 100, 30);
		frm.add(abb);
		usb.setBounds(25, 150, 360, 30);
		frm.add(usb);
		jpb.setBounds(25, 270, 360, 30);
		frm.add(jpb);
		image.setBounds(25, 230, 175, 30);
		frm.add(image);
		start.setBounds(210, 230, 175, 30);
		frm.add(start);
		frm.setVisible(true);

		dow.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cho.getSelectedItem();

			}
		});
		abb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				frm.dispose();
				System.exit(0);
			}
		});
		usb.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				label1.setFont(new Font("Arial", Font.BOLD, 12));
				label1.setBounds(25, 190, 130, 30);
				frm.add(label1);
				cho1.setBounds(175, 193, 210, 30);
				frm.add(cho1);
			}
		});
		image.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				FileDialog fd = new FileDialog(new Frame());
				fd.setTitle("USB-Medium auswählen");
				fd.setVisible(true);
				fd.setMode(FileDialog.LOAD);
				object = fd.getFile();
			}
		});
		start.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ProcessBuilder builder = new ProcessBuilder("cmd", "/c",
						"diskpart", "list disk");
				try {
					Process p = builder.start();
				} catch (IOException e1) {
					e1.printStackTrace();
				}
			}
		});
		
		Thread zero = new MyThread(
				"http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65740/X15-65740.iso",
				"C:\\Users\\XC\\Desktop\\Win7_Home_Premium_32.iso");
		// und so weiter
		
		// zero.start(); // Startet den Thread parallel!
	}
	
	/**
	 * Internal class
	 */
	private class MyThread extends Thread {
		private String site;
		private String filename;
		private URL url;
		
		private MyThread( String site, String filename ){
			this.site = site;
			this.filename = filename;
		}
		
		@Override
		public void run(){
			try {
				url = new URL(site);
			} catch (MalformedURLException e1) {
				e1.printStackTrace();
			}
			HttpURLConnection connection = null;
			try {
				connection = (HttpURLConnection) url.openConnection();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			float totalDataRead = 0;
			java.io.BufferedInputStream in = null;
			try {
				in = new java.io.BufferedInputStream(connection
						.getInputStream());
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			java.io.FileOutputStream fos = null;
			try {
				fos = new java.io.FileOutputStream(filename);
			} catch (FileNotFoundException e1) {
				e1.printStackTrace();
			}
			java.io.BufferedOutputStream bout = new BufferedOutputStream(
					fos, 1024);
			byte[] data = new byte[1024];
			int i = 0;
			try {
				while ((i = in.read(data, 0, 1024)) >= 0) {
					float filesize = (float) 2463242240.0;
					totalDataRead = totalDataRead + i;
					bout.write(data, 0, i);
					float Percent = (totalDataRead * 100) / filesize;
					jpb.setValue((int) Percent);
				}
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			try {
				bout.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			try {
				in.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	}
	
	public static void main(String[] args) {
		DLgui meinFenster = new DLgui();
		// meinFenster.setVisible(true);
		if (cho.getSelectedIndex() == 0) {
			zero.start();
		}
	}
}

Siehe da, nur noch knapp 200 Zeilen ;)
Und bitte setz solche Klassen besser in ein SPOILER-Tag... du siehst ja selbst wie unübersichtlich die Posts sonst werden.
 

chewee

Mitglied
Hey echt coole Nummer das du dir so viel Zeit nimmst das alles zu erklären.
Sieht man ja nicht oft ;)

Soweit läuft das jetzt alles...
Aaaber eine Frage hab ich da noch...
Ich hab schon ein bisschen gegoogelt aber das was ich gefunden habe, war nicht wirklich brauchbar.

Hast du schon mal mit Java, ohne externe Programme, eine iso Datei entpackt?
Also ich brauch ja den Inhalt des Windows Image auf der Festplatte bzw dann auf dem Stick.
Ich hab halt was von loopy gefunden, aber auf der Seite stand nichts weiter...
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
hdi SWT SWT Table: 2 kleine Probleme AWT, Swing, JavaFX & SWT 4
N 3 kleine Probleme AWT, Swing, JavaFX & SWT 7
W Kleine Sub-Tabelle in SpreadsheetView-Zelle anzeigen AWT, Swing, JavaFX & SWT 9
I Swing Beim Fenster das kleine Symbol(ICS) ändern AWT, Swing, JavaFX & SWT 3
L JPanel kleine "Animation" AWT, Swing, JavaFX & SWT 7
P Pfeilpolygon per Maus rotierbar machen - Kleine Schwierigkeiten AWT, Swing, JavaFX & SWT 29
Z kleine JButtons und ihre Beschriftung AWT, Swing, JavaFX & SWT 5
H kleine Bildbearbeitung AWT, Swing, JavaFX & SWT 3
M Zoomen in ein JPanel... und eine andere kleine Frage AWT, Swing, JavaFX & SWT 3
S Swing Kleine Bilder in Panel einfügen AWT, Swing, JavaFX & SWT 13
E AWT Kleine Hilfestellung bei Bildern in Mediatracker AWT, Swing, JavaFX & SWT 7
G Sehr kleine JButtons mit Icon oder Beschriftung AWT, Swing, JavaFX & SWT 2
M 2 Kleine Fragen zum JOptionFrame AWT, Swing, JavaFX & SWT 5
K kleine frage zum Spinner (bezüglich Action) AWT, Swing, JavaFX & SWT 2
G kleine Frage beim initialisieren AWT, Swing, JavaFX & SWT 2
R Kleine Panels auf einem großen Panel frei platzieren AWT, Swing, JavaFX & SWT 11
F kleine Zahlen/buchstaben mit Java darstellen? AWT, Swing, JavaFX & SWT 3
J Kleine frage zu PixelGrabber AWT, Swing, JavaFX & SWT 3
S kleine Frage zu drawPolygon AWT, Swing, JavaFX & SWT 5
G kleine JDesktopPane problem AWT, Swing, JavaFX & SWT 2
XWing Swing Image anzeigen und probleme mit klassen AWT, Swing, JavaFX & SWT 3
E repaint Probleme AWT, Swing, JavaFX & SWT 13
mananana Mögliche probleme die in einer GUI passieren Können AWT, Swing, JavaFX & SWT 6
S GridBagLayout - Probleme mit Bilderanzeige AWT, Swing, JavaFX & SWT 3
I Probleme beim Drucken auf einen PDF-Drucker AWT, Swing, JavaFX & SWT 8
J Probleme mit idividueller Tablecell AWT, Swing, JavaFX & SWT 0
D JavaFX Probleme beim nachtäglichen hinzufügen der jfx dependency AWT, Swing, JavaFX & SWT 7
J Probleme mit InputDialog AWT, Swing, JavaFX & SWT 4
D JavaFX TextArea Probleme bei langen Zeilen AWT, Swing, JavaFX & SWT 1
G JavaFX SplitPane Anwendung - Controller Probleme AWT, Swing, JavaFX & SWT 5
K Probleme bei der Erstellung und Ausführung einer Jar Datei AWT, Swing, JavaFX & SWT 2
B Probleme Action Listener Taschenrechner AWT, Swing, JavaFX & SWT 27
pph080560 JavaFX Probleme mit FX AWT, Swing, JavaFX & SWT 3
M Probleme mit OpenJDK AWT, Swing, JavaFX & SWT 6
B 2D-Grafik paintcomponent Probleme beim zeichnen AWT, Swing, JavaFX & SWT 10
B Swing Probleme mit dem Layout AWT, Swing, JavaFX & SWT 1
L JavaFX Probleme beim Installieren JavaFX11 / JavaFX12 -- Eclipse 2019-03 AWT, Swing, JavaFX & SWT 3
Fiedlerdan Image-Pfad Probleme nach Export aus Eclipse AWT, Swing, JavaFX & SWT 31
H JFreeChart - DemoDataSetFactory Probleme AWT, Swing, JavaFX & SWT 1
H LayoutManager Probleme mit Positionierung/Abständen der Komponenten AWT, Swing, JavaFX & SWT 14
A Probleme mit gridheight (GridBagLayout) AWT, Swing, JavaFX & SWT 6
U Opaque Probleme AWT, Swing, JavaFX & SWT 3
H JavaFX Probleme Beim Wechseln der scene als .fxml AWT, Swing, JavaFX & SWT 7
F JavaFX Probleme beim automatischen Konvertieren AWT, Swing, JavaFX & SWT 4
S Probleme mit JComboboxen(?) AWT, Swing, JavaFX & SWT 18
S Swing Probleme mit MigLayout AWT, Swing, JavaFX & SWT 2
C Probleme mit createImage AWT, Swing, JavaFX & SWT 1
J Probleme mit contex Menu (javafx) AWT, Swing, JavaFX & SWT 1
J Probleme bei GameofLife AWT, Swing, JavaFX & SWT 24
S JavaFx - Button ActionEvent Probleme AWT, Swing, JavaFX & SWT 3
T Swing Probleme mit repaint() bzw. JScrollPane AWT, Swing, JavaFX & SWT 7
ImperatorMing JavaFX Probleme mit WindowEvent AWT, Swing, JavaFX & SWT 0
ImperatorMing JavaFX Probleme mit WindowEvent AWT, Swing, JavaFX & SWT 5
J LayoutManager GridBagLayout, probleme mit Anordnung von Objekten AWT, Swing, JavaFX & SWT 6
T Java FX Probleme beim befüllen eines Tableviews AWT, Swing, JavaFX & SWT 5
S AWT Probleme beim Zeichnen AWT, Swing, JavaFX & SWT 3
A Swing Probleme mit dem adden von JButtons zur JScrollPane AWT, Swing, JavaFX & SWT 2
D Swing Probleme mit dem Resizing AWT, Swing, JavaFX & SWT 7
G Probleme mit TextArea AWT, Swing, JavaFX & SWT 5
G JFrame Probleme AWT, Swing, JavaFX & SWT 2
K Probleme beim JPasswordField AWT, Swing, JavaFX & SWT 11
G Cardlayout Refresh Probleme AWT, Swing, JavaFX & SWT 2
J Swing Probleme mit ListSelectionListener(), Inhalte der JList werden gelöscht? AWT, Swing, JavaFX & SWT 6
D JavaFX Probleme bei Service-Klasse beim ändern der GUI AWT, Swing, JavaFX & SWT 8
K Probleme beim zeichnen mit paintComponent() AWT, Swing, JavaFX & SWT 1
M JButton Probleme AWT, Swing, JavaFX & SWT 14
L Probleme mit Programm AWT, Swing, JavaFX & SWT 13
blazingblade komischerweise probleme mit jtextfield.gettext() AWT, Swing, JavaFX & SWT 9
Xanny 2D-Grafik Beginner! Probleme mit Swing, Gprahics class und paint AWT, Swing, JavaFX & SWT 13
Sin137 LayoutManager GridBagLayout Probleme AWT, Swing, JavaFX & SWT 6
H Netbeans Designer: Probleme mit JPanel und JFrame AWT, Swing, JavaFX & SWT 2
M Swing Probleme mit Frame.pack() AWT, Swing, JavaFX & SWT 1
C Java FX Probleme beim Schließen einer Stage AWT, Swing, JavaFX & SWT 11
M Swing JProgressbar und Outoputstream probleme AWT, Swing, JavaFX & SWT 2
S Swing Probleme mit transparenz der Hintergrundfarbe und JRadioButtons AWT, Swing, JavaFX & SWT 2
Z Probleme mit JPanel's AWT, Swing, JavaFX & SWT 6
T Probleme mit Anzeige von Elementen im JPanel AWT, Swing, JavaFX & SWT 1
Shams Probleme bei dem Hinzufügen von Komponenten zu einem JFrame AWT, Swing, JavaFX & SWT 3
A Swing Probleme mit JScrollPane AWT, Swing, JavaFX & SWT 6
M Layout-Probleme unter Swing AWT, Swing, JavaFX & SWT 5
H Swing Probleme beim erstellen eines neuen Objektes durch einen Button AWT, Swing, JavaFX & SWT 10
J JavaFX JavaFX Probleme bei der Anzeige von Text AWT, Swing, JavaFX & SWT 18
A Probleme mit TilledBorder("***") AWT, Swing, JavaFX & SWT 4
F Bildschirmschoner Probleme mit Preview AWT, Swing, JavaFX & SWT 8
X Panel Probleme (Tetris) AWT, Swing, JavaFX & SWT 8
N JTable probleme AWT, Swing, JavaFX & SWT 5
B Probleme bei ImageIO.read (?!) AWT, Swing, JavaFX & SWT 9
P JFrame Location-/Size-Probleme AWT, Swing, JavaFX & SWT 5
U LayoutManager Probleme mit Layouts AWT, Swing, JavaFX & SWT 5
L NullpointerException und Probleme mit repaint() AWT, Swing, JavaFX & SWT 11
A Probleme mit 2 JFrames in einem Programm AWT, Swing, JavaFX & SWT 7
K LayoutManager Probleme mit 2 Komponenten AWT, Swing, JavaFX & SWT 9
C Probleme mit Buttons und einem ActionListener AWT, Swing, JavaFX & SWT 2
M Probleme mit Verkleinern eines GUI AWT, Swing, JavaFX & SWT 7
B Swing label.setText() macht probleme AWT, Swing, JavaFX & SWT 5
B ImageIcon - Probleme mit dem Dateipfad AWT, Swing, JavaFX & SWT 5
H JTree Probleme AWT, Swing, JavaFX & SWT 9
F Probleme mit (Graphics g) II AWT, Swing, JavaFX & SWT 4
F Probleme mit (Graphics g) AWT, Swing, JavaFX & SWT 3
K 2D-Grafik .GIF macht mir Probleme AWT, Swing, JavaFX & SWT 14

Ähnliche Java Themen

Neue Themen


Oben