Skip to content
Home
Post Code
Jass (Warcraft III)
Wurst
GUI (Warcraft III)
Galaxy (StarCraft II)
GUI (StarCraft II)
C++
Java
Delphi
Text
Search Code
Compare Code
Uploads
Draw
Create New Drawing
View Drawings
Graph
Log in
[code]package systems.crigges.kamil; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JTextField; import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.border.LineBorder; import javax.swing.plaf.FileChooserUI; import java.awt.Color; import java.awt.[color=AA77FF]event[/color].ActionListener; import java.io.File; import java.io.FileOutputStream; import java.nio.file.Files; import java.awt.[color=AA77FF]event[/color].ActionEvent; [color=7777FF][b]public[/b][/color] class Kamil [b]{[/b] [color=7777FF][b]private[/b][/color] JFrame frame; [color=7777FF][b]private[/b][/color] JTextField textField; [color=7777FF][b]private[/b][/color] JTextField textField_1; [color=7777FF][b]private[/b][/color] JTextField textField_2; [color=999999][i]/**[/i][/color] [color=999999][i] * Launch the application.[/i][/color] [color=999999][i] * @throws UnsupportedLookAndFeelException[/i][/color] [color=999999][i] * @throws IllegalAccessException[/i][/color] [color=999999][i] * @throws InstantiationException[/i][/color] [color=999999][i] * @throws ClassNotFoundException[/i][/color] [color=999999][i] */[/i][/color] [color=7777FF][b]public[/b][/color] [color=7777FF][b]static[/b][/color] void main[b]([/b]String[b][[/b][b]][/b] args[b])[/b] throws ClassNotFoundException[b],[/b] InstantiationException[b],[/b] IllegalAccessException[b],[/b] UnsupportedLookAndFeelException [b]{[/b] UIManager.setLookAndFeel[b]([/b]UIManager.getSystemLookAndFeelClassName[b]([/b][b])[/b][b])[/b]; EventQueue.invokeLater[b]([/b]new Runnable[b]([/b][b])[/b] [b]{[/b] [color=7777FF][b]public[/b][/color] void run[b]([/b][b])[/b] [b]{[/b] try [b]{[/b] Kamil window [b]=[/b] new Kamil[b]([/b][b])[/b]; window.frame.setVisible[b]([/b]true[b])[/b]; [b]}[/b] catch [b]([/b]Exception e[b])[/b] [b]{[/b] e.printStackTrace[b]([/b][b])[/b]; [b]}[/b] [b]}[/b] [b]}[/b][b])[/b]; [b]}[/b] [color=999999][i]/**[/i][/color] [color=999999][i] * Create the application.[/i][/color] [color=999999][i] */[/i][/color] [color=7777FF][b]public[/b][/color] Kamil[b]([/b][b])[/b] [b]{[/b] initialize[b]([/b][b])[/b]; [b]}[/b] [color=999999][i]/**[/i][/color] [color=999999][i] * Initialize the contents of the frame.[/i][/color] [color=999999][i] */[/i][/color] [color=7777FF][b]private[/b][/color] void initialize[b]([/b][b])[/b] [b]{[/b] frame [b]=[/b] new JFrame[b]([/b][b])[/b]; frame.setBounds[b]([/b][color=FFFF77]100[/color][b],[/b] [color=FFFF77]100[/color][b],[/b] [color=FFFF77]729[/color][b],[/b] [color=FFFF77]354[/color][b])[/b]; frame.setDefaultCloseOperation[b]([/b]JFrame.EXIT_ON_CLOSE[b])[/b]; JButton btnSelect [b]=[/b] new JButton[b]([/b][color=77FF77]"Select..."[/color][b])[/b]; btnSelect.addActionListener[b]([/b]new ActionListener[b]([/b][b])[/b] [b]{[/b] [color=7777FF][b]public[/b][/color] void actionPerformed[b]([/b]ActionEvent e[b])[/b] [b]{[/b] JFileChooser fc [b]=[/b] new JFileChooser[b]([/b][b])[/b]; fc.setCurrentDirectory[b]([/b]new File[b]([/b]textField.getText[b]([/b][b])[/b].equals[b]([/b][color=77FF77]""[/color][b])[/b] ? [color=77FF77]"."[/color] : textField.getText[b]([/b][b])[/b][b])[/b][b])[/b]; fc.setFileSelectionMode[b]([/b]JFileChooser.DIRECTORIES_ONLY[b])[/b]; fc.setAcceptAllFileFilterUsed[b]([/b]false[b])[/b]; [color=7777FF][b]if[/b][/color] [b]([/b]fc.showOpenDialog[b]([/b]frame[b])[/b] [b]=[/b][b]=[/b] JFileChooser.APPROVE_OPTION[b])[/b] [b]{[/b] textField.setText[b]([/b]fc.getSelectedFile[b]([/b][b])[/b].getAbsolutePath[b]([/b][b])[/b][b])[/b]; [b]}[/b] [b]}[/b] [b]}[/b][b])[/b]; textField [b]=[/b] new JTextField[b]([/b][b])[/b]; textField.setEditable[b]([/b]false[b])[/b]; textField.setColumns[b]([/b][color=FFFF77]10[/color][b])[/b]; JLabel lblSource [b]=[/b] new JLabel[b]([/b][color=77FF77]"Source Folder"[/color][b])[/b]; textField_1 [b]=[/b] new JTextField[b]([/b][b])[/b]; textField_1.setEditable[b]([/b]false[b])[/b]; textField_1.setColumns[b]([/b][color=FFFF77]10[/color][b])[/b]; JLabel lblDestinationFolder [b]=[/b] new JLabel[b]([/b][color=77FF77]"Destination Folder"[/color][b])[/b]; JButton [color=AA77FF]button[/color] [b]=[/b] new JButton[b]([/b][color=77FF77]"Select..."[/color][b])[/b]; [color=AA77FF]button[/color].addActionListener[b]([/b]new ActionListener[b]([/b][b])[/b] [b]{[/b] [color=7777FF][b]public[/b][/color] void actionPerformed[b]([/b]ActionEvent e[b])[/b] [b]{[/b] JFileChooser fc [b]=[/b] new JFileChooser[b]([/b][b])[/b]; fc.setCurrentDirectory[b]([/b]new File[b]([/b]textField_1.getText[b]([/b][b])[/b].equals[b]([/b][color=77FF77]""[/color][b])[/b] ? [color=77FF77]"."[/color] : textField_1.getText[b]([/b][b])[/b] [b])[/b][b])[/b]; fc.setFileSelectionMode[b]([/b]JFileChooser.DIRECTORIES_ONLY[b])[/b]; fc.setAcceptAllFileFilterUsed[b]([/b]false[b])[/b]; [color=7777FF][b]if[/b][/color] [b]([/b]fc.showOpenDialog[b]([/b]frame[b])[/b] [b]=[/b][b]=[/b] JFileChooser.APPROVE_OPTION[b])[/b] [b]{[/b] textField_1.setText[b]([/b]fc.getSelectedFile[b]([/b][b])[/b].getAbsolutePath[b]([/b][b])[/b][b])[/b]; [b]}[/b] [b]}[/b] [b]}[/b][b])[/b]; JButton btnNewButton [b]=[/b] new JButton[b]([/b][color=77FF77]"Process"[/color][b])[/b]; btnNewButton.addActionListener[b]([/b]new ActionListener[b]([/b][b])[/b] [b]{[/b] [color=7777FF][b]public[/b][/color] void actionPerformed[b]([/b]ActionEvent e[b])[/b] [b]{[/b] try[b]{[/b] File sourceFolder [b]=[/b] new File[b]([/b]textField.getText[b]([/b][b])[/b][b])[/b]; File[b][[/b][b]][/b] files [b]=[/b] sourceFolder.listFiles[b]([/b][b])[/b]; [color=7777FF][b]for[/b][/color][b]([/b]File f : files[b])[/b][b]{[/b] String content [b]=[/b] new String[b]([/b]Files.readAllBytes[b]([/b]f.toPath[b]([/b][b])[/b][b])[/b][b])[/b]; int index [b]=[/b] content.lastIndexOf[b]([/b][color=77FF77]";$ZYKART_ENDE"[/color][b])[/b]; String before [b]=[/b] content.substring[b]([/b][color=FFFF77]0[/color][b],[/b] index[b])[/b]; String after [b]=[/b] content.substring[b]([/b]index[b])[/b]; String res [b]=[/b] before [b]+[/b] [color=77FF77]";$ZYKLUS_ENDE\r\n"[/color] [b]+[/b] after; FileOutputStream out [b]=[/b] new FileOutputStream[b]([/b]new File[b]([/b]textField_1.getText[b]([/b][b])[/b] [b]+[/b] [color=77FF77]"\\"[/color] [b]+[/b] f.getName[b]([/b][b])[/b][b])[/b][b])[/b]; out.write[b]([/b]res.getBytes[b]([/b][b])[/b][b])[/b]; out.close[b]([/b][b])[/b]; [color=7777FF][b]if[/b][/color][b]([/b][b]![/b]textField_2.getText[b]([/b][b])[/b].equals[b]([/b][color=77FF77]""[/color][b])[/b][b])[/b][b]{[/b] out [b]=[/b] new FileOutputStream[b]([/b]new File[b]([/b]textField_2.getText[b]([/b][b])[/b] [b]+[/b] [color=77FF77]"\\"[/color] [b]+[/b] f.getName[b]([/b][b])[/b][b])[/b][b])[/b]; out.write[b]([/b]res.getBytes[b]([/b][b])[/b][b])[/b]; out.close[b]([/b][b])[/b]; [b]}[/b] f.delete[b]([/b][b])[/b]; [b]}[/b] [b]}[/b]catch[b]([/b]Exception ec[b])[/b][b]{[/b] ec.printStackTrace[b]([/b][b])[/b];; [b]}[/b] [b]}[/b] [b]}[/b][b])[/b]; JLabel lblDestinationFolder_1 [b]=[/b] new JLabel[b]([/b][color=77FF77]"Destination Folder 2"[/color][b])[/b]; textField_2 [b]=[/b] new JTextField[b]([/b][b])[/b]; textField_2.setEditable[b]([/b]false[b])[/b]; textField_2.setColumns[b]([/b][color=FFFF77]10[/color][b])[/b]; JButton button_1 [b]=[/b] new JButton[b]([/b][color=77FF77]"Select..."[/color][b])[/b]; button_1.addActionListener[b]([/b]new ActionListener[b]([/b][b])[/b] [b]{[/b] [color=7777FF][b]public[/b][/color] void actionPerformed[b]([/b]ActionEvent e[b])[/b] [b]{[/b] JFileChooser fc [b]=[/b] new JFileChooser[b]([/b][b])[/b]; fc.setCurrentDirectory[b]([/b]new File[b]([/b]textField_2.getText[b]([/b][b])[/b].equals[b]([/b][color=77FF77]""[/color][b])[/b] ? [color=77FF77]"."[/color] : textField_2.getText[b]([/b][b])[/b] [b])[/b][b])[/b]; fc.setFileSelectionMode[b]([/b]JFileChooser.DIRECTORIES_ONLY[b])[/b]; fc.setAcceptAllFileFilterUsed[b]([/b]false[b])[/b]; [color=7777FF][b]if[/b][/color] [b]([/b]fc.showOpenDialog[b]([/b]frame[b])[/b] [b]=[/b][b]=[/b] JFileChooser.APPROVE_OPTION[b])[/b] [b]{[/b] textField_2.setText[b]([/b]fc.getSelectedFile[b]([/b][b])[/b].getAbsolutePath[b]([/b][b])[/b][b])[/b]; [b]}[/b] [b]}[/b] [b]}[/b][b])[/b]; GroupLayout groupLayout [b]=[/b] new GroupLayout[b]([/b]frame.getContentPane[b]([/b][b])[/b][b])[/b]; groupLayout.setHorizontalGroup[b]([/b] groupLayout.createParallelGroup[b]([/b]Alignment.TRAILING[b])[/b] .addGroup[b]([/b]groupLayout.createSequentialGroup[b]([/b][b])[/b] .addContainerGap[b]([/b][b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.LEADING[b])[/b] .addComponent[b]([/b]lblSource[b])[/b] .addComponent[b]([/b]btnNewButton[b],[/b] Alignment.TRAILING[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] [color=FFFF77]143[/color][b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b] .addGroup[b]([/b]Alignment.TRAILING[b],[/b] groupLayout.createSequentialGroup[b]([/b][b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.LEADING[b])[/b] .addComponent[b]([/b]textField_1[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] [color=FFFF77]493[/color][b],[/b] Short.MAX_VALUE[b])[/b] .addComponent[b]([/b]textField[b],[/b] Alignment.TRAILING[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] [color=FFFF77]493[/color][b],[/b] Short.MAX_VALUE[b])[/b][b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.LEADING[b],[/b] false[b])[/b] .addComponent[b]([/b]btnSelect[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] Short.MAX_VALUE[b])[/b] .addComponent[b]([/b][color=AA77FF]button[/color][b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] [color=FFFF77]101[/color][b],[/b] Short.MAX_VALUE[b])[/b][b])[/b][b])[/b] .addGroup[b]([/b]Alignment.TRAILING[b],[/b] groupLayout.createSequentialGroup[b]([/b][b])[/b] .addComponent[b]([/b]textField_2[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] [color=FFFF77]567[/color][b],[/b] Short.MAX_VALUE[b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addComponent[b]([/b]button_1[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] [color=FFFF77]101[/color][b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b][b])[/b] .addComponent[b]([/b]lblDestinationFolder_1[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] [color=FFFF77]182[/color][b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b] .addComponent[b]([/b]lblDestinationFolder[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] [color=FFFF77]182[/color][b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b][b])[/b] .addContainerGap[b]([/b][b])[/b][b])[/b] [b])[/b]; groupLayout.setVerticalGroup[b]([/b] groupLayout.createParallelGroup[b]([/b]Alignment.LEADING[b])[/b] .addGroup[b]([/b]groupLayout.createSequentialGroup[b]([/b][b])[/b] .addContainerGap[b]([/b][b])[/b] .addComponent[b]([/b]lblSource[b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.BASELINE[b])[/b] .addComponent[b]([/b]textField[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b] .addComponent[b]([/b]btnSelect[b])[/b][b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addComponent[b]([/b]lblDestinationFolder[b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.BASELINE[b])[/b] .addComponent[b]([/b]textField_1[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b] .addComponent[b]([/b][color=AA77FF]button[/color][b])[/b][b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addGroup[b]([/b]groupLayout.createParallelGroup[b]([/b]Alignment.TRAILING[b])[/b] .addGroup[b]([/b]groupLayout.createSequentialGroup[b]([/b][b])[/b] .addComponent[b]([/b]lblDestinationFolder_1[b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b])[/b] .addComponent[b]([/b]textField_2[b],[/b] GroupLayout.PREFERRED_SIZE[b],[/b] GroupLayout.DEFAULT_SIZE[b],[/b] GroupLayout.PREFERRED_SIZE[b])[/b][b])[/b] .addComponent[b]([/b]button_1[b])[/b][b])[/b] .addPreferredGap[b]([/b]ComponentPlacement.RELATED[b],[/b] [color=FFFF77]38[/color][b],[/b] Short.MAX_VALUE[b])[/b] .addComponent[b]([/b]btnNewButton[b])[/b] .addContainerGap[b]([/b][b])[/b][b])[/b] [b])[/b]; frame.getContentPane[b]([/b][b])[/b].setLayout[b]([/b]groupLayout[b])[/b]; [b]}[/b] [b]}[/b] [/code]
Diesen Code in Standard-Formatierung anzeigen
select language
> jass
java
delphi
C++
php
GSL
galaxy
visualBasic
wurst
Text
Markdown
select style
default
> bbcode - default
Jasscraft
jasscraft html
visual
lightweight
lightweightNr
goto line:
Compare with:
text copy window
edit this code
post new code
package systems.crigges.kamil; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JTextField; import javax.swing.LayoutStyle.ComponentPlacement; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.border.LineBorder; import javax.swing.plaf.FileChooserUI; import java.awt.Color; import java.awt.event.ActionListener; import java.io.File; import java.io.FileOutputStream; import java.nio.file.Files; import java.awt.event.ActionEvent; public class Kamil { private JFrame frame; private JTextField textField; private JTextField textField_1; private JTextField textField_2; /** * Launch the application. * @throws UnsupportedLookAndFeelException * @throws IllegalAccessException * @throws InstantiationException * @throws ClassNotFoundException */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); EventQueue.invokeLater(new Runnable() { public void run() { try { Kamil window = new Kamil(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public Kamil() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 729, 354); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton btnSelect = new JButton("Select..."); btnSelect.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(textField.getText().equals("") ? "." : textField.getText())); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setAcceptAllFileFilterUsed(false); if (fc.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) { textField.setText(fc.getSelectedFile().getAbsolutePath()); } } }); textField = new JTextField(); textField.setEditable(false); textField.setColumns(10); JLabel lblSource = new JLabel("Source Folder"); textField_1 = new JTextField(); textField_1.setEditable(false); textField_1.setColumns(10); JLabel lblDestinationFolder = new JLabel("Destination Folder"); JButton button = new JButton("Select..."); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(textField_1.getText().equals("") ? "." : textField_1.getText() )); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setAcceptAllFileFilterUsed(false); if (fc.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) { textField_1.setText(fc.getSelectedFile().getAbsolutePath()); } } }); JButton btnNewButton = new JButton("Process"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try{ File sourceFolder = new File(textField.getText()); File[] files = sourceFolder.listFiles(); for(File f : files){ String content = new String(Files.readAllBytes(f.toPath())); int index = content.lastIndexOf(";$ZYKART_ENDE"); String before = content.substring(0, index); String after = content.substring(index); String res = before + ";$ZYKLUS_ENDE\r\n" + after; FileOutputStream out = new FileOutputStream(new File(textField_1.getText() + "\\" + f.getName())); out.write(res.getBytes()); out.close(); if(!textField_2.getText().equals("")){ out = new FileOutputStream(new File(textField_2.getText() + "\\" + f.getName())); out.write(res.getBytes()); out.close(); } f.delete(); } }catch(Exception ec){ ec.printStackTrace();; } } }); JLabel lblDestinationFolder_1 = new JLabel("Destination Folder 2"); textField_2 = new JTextField(); textField_2.setEditable(false); textField_2.setColumns(10); JButton button_1 = new JButton("Select..."); button_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(textField_2.getText().equals("") ? "." : textField_2.getText() )); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.setAcceptAllFileFilterUsed(false); if (fc.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) { textField_2.setText(fc.getSelectedFile().getAbsolutePath()); } } }); GroupLayout groupLayout = new GroupLayout(frame.getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(lblSource) .addComponent(btnNewButton, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 143, GroupLayout.PREFERRED_SIZE) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(textField_1, GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE) .addComponent(textField, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addComponent(btnSelect, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(button, GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE))) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addComponent(textField_2, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(button_1, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)) .addComponent(lblDestinationFolder_1, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE) .addComponent(lblDestinationFolder, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(lblSource) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(btnSelect)) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblDestinationFolder) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(button)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addComponent(lblDestinationFolder_1) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(button_1)) .addPreferredGap(ComponentPlacement.RELATED, 38, Short.MAX_VALUE) .addComponent(btnNewButton) .addContainerGap()) ); frame.getContentPane().setLayout(groupLayout); } }