Compare commits
7
Commits
af863d9514
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
594f2957e6 | ||
|
|
302d193651 | ||
|
|
1585766b5a | ||
|
|
45e094d635 | ||
|
|
bbec150a35 | ||
|
|
62ad4211e8 | ||
|
|
9db2d425c1 |
No files matched your search
+10
-9
@@ -1,9 +1,10 @@
|
|||||||
/build/
|
/build/
|
||||||
/nbproject/private/
|
/nbproject/private/
|
||||||
*.xml
|
*.xml
|
||||||
*.properties
|
*.properties
|
||||||
*.mf
|
*.mf
|
||||||
/dist/
|
/dist/
|
||||||
/wurfel/nbproject/private/
|
/wurfel/nbproject/private/
|
||||||
/wurfel/dist/
|
/wurfel/dist/
|
||||||
/wurfel/build/
|
/wurfel/build/
|
||||||
|
/ChatProg/build/
|
||||||
Executable
+69
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package chatProg;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
import chatProg.controller.ReceiveAdapter;
|
||||||
|
import chatProg.controller.CommandConnect;
|
||||||
|
import chatProg.controller.CommandSend;
|
||||||
|
import chatProg.model.ChatModel;
|
||||||
|
import chatProg.view.ChatView;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import chatProg.logger.OhmLogger;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builder Class
|
||||||
|
* @author chris, hd
|
||||||
|
*/
|
||||||
|
public class Start
|
||||||
|
{
|
||||||
|
private static Logger lg = OhmLogger.getLogger();
|
||||||
|
|
||||||
|
public Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
JFrame frm = new JFrame();
|
||||||
|
frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
ChatView view = new ChatView();
|
||||||
|
ChatModel model = new ChatModel();
|
||||||
|
|
||||||
|
CommandConnect cmdConnect = new CommandConnect(view, model);
|
||||||
|
cmdConnect.registerEvents();
|
||||||
|
|
||||||
|
CommandSend cmdSend = new CommandSend(view, model);
|
||||||
|
cmdSend.registerEvents();
|
||||||
|
|
||||||
|
ReceiveAdapter recAdapter = new ReceiveAdapter(view, model);
|
||||||
|
recAdapter.subscribe();
|
||||||
|
|
||||||
|
view.setVisible(true);
|
||||||
|
view.setTitle("Chat");
|
||||||
|
|
||||||
|
view.setSize(800, 600);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
JOptionPane.showMessageDialog(null, ex.toString());
|
||||||
|
}
|
||||||
|
new Start();
|
||||||
|
new Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package chatProg.controller;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import chatProg.logger.OhmLogger;
|
||||||
|
import chatProg.model.ChatModel;
|
||||||
|
import chatProg.view.ChatView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author hd, chris
|
||||||
|
*/
|
||||||
|
public class CommandConnect implements ActionListener
|
||||||
|
{
|
||||||
|
|
||||||
|
private static Logger lg = OhmLogger.getLogger();
|
||||||
|
ChatView view;
|
||||||
|
ChatModel model;
|
||||||
|
|
||||||
|
private static final int PORT = 35000;
|
||||||
|
private static final String IP_ADRESSE = "127.0.0.1";
|
||||||
|
|
||||||
|
|
||||||
|
public CommandConnect(ChatView view, ChatModel transmitter)
|
||||||
|
{
|
||||||
|
this.view = view;
|
||||||
|
this.model = transmitter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerEvents(){
|
||||||
|
view.getBtnSetServer().addActionListener(this);
|
||||||
|
view.getBtnSetClient().addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
Object src = e.getSource();
|
||||||
|
|
||||||
|
// connect to server
|
||||||
|
if(src == view.getBtnSetServer()){
|
||||||
|
synchronized (this){
|
||||||
|
try {
|
||||||
|
view.getLblType().setText("Server");
|
||||||
|
model.setServer(PORT);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
lg.severe(ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// connect to vlient
|
||||||
|
if(src == view.getBtnSetClient()){
|
||||||
|
synchronized (this){
|
||||||
|
try {
|
||||||
|
view.getLblType().setText("Client");
|
||||||
|
model.setClient(PORT, IP_ADRESSE);
|
||||||
|
|
||||||
|
} catch (IOException ex) {
|
||||||
|
lg.severe(ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package chatProg.controller;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import chatProg.logger.OhmLogger;
|
||||||
|
import chatProg.model.ChatModel;
|
||||||
|
import chatProg.view.ChatView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author hd, christ
|
||||||
|
*/
|
||||||
|
public class CommandSend implements ActionListener
|
||||||
|
{
|
||||||
|
private static Logger lg = OhmLogger.getLogger();
|
||||||
|
ChatView view;
|
||||||
|
ChatModel model;
|
||||||
|
|
||||||
|
public CommandSend(ChatView view, ChatModel model)
|
||||||
|
{
|
||||||
|
this.view = view;
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void registerEvents(){
|
||||||
|
view.getBtnSend().addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
Object src = e.getSource();
|
||||||
|
|
||||||
|
if(src == view.getBtnSend()){
|
||||||
|
String msg = view.getTxtField().getText();
|
||||||
|
if(msg != ""){
|
||||||
|
model.sendMessage(msg);
|
||||||
|
view.getLblStatusDialog().setText("Nachricht gesendet");
|
||||||
|
view.getjTextArea().append("Ich: " + msg +"\n");
|
||||||
|
}
|
||||||
|
view.getTxtField().setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package chatProg.controller;
|
||||||
|
|
||||||
|
import java.util.concurrent.Flow;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import chatProg.logger.OhmLogger;
|
||||||
|
import chatProg.model.ChatModel;
|
||||||
|
import chatProg.view.ChatView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author hd, chris
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ReceiveAdapter implements Flow.Subscriber<String>
|
||||||
|
{
|
||||||
|
private static Logger lg = OhmLogger.getLogger();
|
||||||
|
|
||||||
|
private ChatView view;
|
||||||
|
private ChatModel model;
|
||||||
|
private Flow.Subscription subscription;
|
||||||
|
|
||||||
|
public ReceiveAdapter(ChatView view, ChatModel model)
|
||||||
|
{
|
||||||
|
this.view = view;
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void subscribe()
|
||||||
|
{
|
||||||
|
model.addSubscription(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Flow.Subscription subscription)
|
||||||
|
{
|
||||||
|
this.subscription = subscription;
|
||||||
|
subscription.request(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(String item)
|
||||||
|
{
|
||||||
|
view.getLblStatusDialog().setText("Nachricht empfangen");
|
||||||
|
view.getjTextArea().append("Partner: " + item + "\n");
|
||||||
|
subscription.request(1);
|
||||||
|
//System.out.println(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable throwable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package ohmlogger;
|
package chatProg.logger;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.logging.Formatter;
|
import java.util.logging.Formatter;
|
||||||
@@ -3,9 +3,10 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package ohmlogger;
|
package chatProg.logger;
|
||||||
|
|
||||||
|
|
||||||
|
import chatProg.logger.MyFormatter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
@@ -37,7 +38,6 @@ public class OhmLogger
|
|||||||
try{
|
try{
|
||||||
String datei = System.getProperty("java.io.tmpdir") + File.separator + "log.txt";
|
String datei = System.getProperty("java.io.tmpdir") + File.separator + "log.txt";
|
||||||
FileHandler fh = new FileHandler(datei);
|
FileHandler fh = new FileHandler(datei);
|
||||||
fh.setFormatter(new MyFormatter());
|
|
||||||
ConsoleHandler ch = new ConsoleHandler();
|
ConsoleHandler ch = new ConsoleHandler();
|
||||||
lg.addHandler(fh);
|
lg.addHandler(fh);
|
||||||
ch.setFormatter(new MyFormatter());
|
ch.setFormatter(new MyFormatter());
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package chatProg.model;
|
||||||
|
|
||||||
|
|
||||||
|
import chatProg.logger.OhmLogger;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.net.ServerSocket;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Flow;
|
||||||
|
import java.util.concurrent.SubmissionPublisher;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author hd, chris
|
||||||
|
*/
|
||||||
|
public class ChatModel implements Runnable
|
||||||
|
{
|
||||||
|
private static Logger lg = OhmLogger.getLogger();
|
||||||
|
|
||||||
|
private ExecutorService eService;
|
||||||
|
private SubmissionPublisher<String> iPublisher;
|
||||||
|
private volatile boolean laufend;
|
||||||
|
|
||||||
|
String nachricht;
|
||||||
|
|
||||||
|
BufferedReader in;
|
||||||
|
PrintWriter out;
|
||||||
|
|
||||||
|
private Socket socket;
|
||||||
|
|
||||||
|
public ChatModel()
|
||||||
|
{
|
||||||
|
laufend = false;
|
||||||
|
iPublisher = new SubmissionPublisher<>();
|
||||||
|
eService = Executors.newSingleThreadExecutor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSubscription(Flow.Subscriber<String> subscriber)
|
||||||
|
{
|
||||||
|
iPublisher.subscribe(subscriber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void start(){
|
||||||
|
laufend = true;
|
||||||
|
eService.submit(this);
|
||||||
|
this.notifyAll();//muss sync
|
||||||
|
lg.info("startet");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
while(true){
|
||||||
|
try {
|
||||||
|
nachricht = in.readLine();
|
||||||
|
lg.info("Nachricht empfangen: " + nachricht);
|
||||||
|
iPublisher.submit(nachricht);//wenn neue Nachricht
|
||||||
|
} catch (IOException ex) {
|
||||||
|
lg.log(Level.SEVERE, ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSocket(Socket s) throws IOException {
|
||||||
|
InputStream iStream = s.getInputStream();
|
||||||
|
OutputStream oStream = s.getOutputStream();
|
||||||
|
|
||||||
|
InputStreamReader isr = new InputStreamReader(iStream, "UTF-8");
|
||||||
|
OutputStreamWriter osr = new OutputStreamWriter(oStream, "UTF-8");
|
||||||
|
|
||||||
|
in = new BufferedReader(isr);
|
||||||
|
//BufferedWriter out = new BufferedWriter(osr);
|
||||||
|
out = new PrintWriter(osr);
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
public void setClient(int PORT, String IP_ADRESSE) throws IOException
|
||||||
|
{
|
||||||
|
Thread connectThread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
lg.info("Client: verbinde ...");
|
||||||
|
Socket s = new Socket(IP_ADRESSE, PORT); // Achtung: blockiert!
|
||||||
|
lg.info("Client: Verbindung hergestellt");
|
||||||
|
setSocket(s);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connectThread.start();
|
||||||
|
}
|
||||||
|
public void setServer(int PORT) throws IOException
|
||||||
|
{
|
||||||
|
Thread connectThread = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
ServerSocket sSocket = new ServerSocket(PORT);
|
||||||
|
lg.info("Server: Warte auf Verbindung ...");
|
||||||
|
Socket s = sSocket.accept(); // Achtung: blockiert!
|
||||||
|
lg.info("Server: Verbindung akzeptiert");
|
||||||
|
setSocket(s);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connectThread.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMessage(String msg)
|
||||||
|
{
|
||||||
|
if(laufend){
|
||||||
|
lg.log(Level.INFO, "Sende Nachricht: " + msg);
|
||||||
|
out.println(msg);
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
lg.log(Level.INFO, "Keine Verbindung!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -37,9 +37,6 @@
|
|||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JLabel" name="lblType">
|
<Component class="javax.swing.JLabel" name="lblType">
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Client"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="btnSetClient">
|
<Component class="javax.swing.JButton" name="btnSetClient">
|
||||||
<Properties>
|
<Properties>
|
||||||
@@ -53,16 +50,6 @@
|
|||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Component class="javax.swing.JTextField" name="txtField">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="jTextField1"/>
|
|
||||||
</Properties>
|
|
||||||
<Constraints>
|
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
|
||||||
<BorderConstraints direction="Center"/>
|
|
||||||
</Constraint>
|
|
||||||
</Constraints>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="btnSend">
|
<Component class="javax.swing.JButton" name="btnSend">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Send"/>
|
<Property name="text" type="java.lang.String" value="Send"/>
|
||||||
@@ -83,5 +70,43 @@
|
|||||||
</Constraint>
|
</Constraint>
|
||||||
</Constraints>
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||||
|
<BorderConstraints direction="Center"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
|
||||||
|
<Property name="columns" type="int" value="1"/>
|
||||||
|
<Property name="rows" type="int" value="2"/>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextArea" name="jTextArea">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="cc" green="cc" red="cc" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columns" type="int" value="20"/>
|
||||||
|
<Property name="rows" type="int" value="5"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtField">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtFieldActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
@@ -3,9 +3,7 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package netz.view;
|
package chatProg.view;
|
||||||
|
|
||||||
import netz.view.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -14,6 +12,14 @@ import netz.view.*;
|
|||||||
public class ChatView extends javax.swing.JFrame
|
public class ChatView extends javax.swing.JFrame
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the jTextArea
|
||||||
|
*/
|
||||||
|
public javax.swing.JTextArea getjTextArea()
|
||||||
|
{
|
||||||
|
return jTextArea;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the btnSend
|
* @return the btnSend
|
||||||
*/
|
*/
|
||||||
@@ -108,16 +114,17 @@ public class ChatView extends javax.swing.JFrame
|
|||||||
lblType = new javax.swing.JLabel();
|
lblType = new javax.swing.JLabel();
|
||||||
btnSetClient = new javax.swing.JButton();
|
btnSetClient = new javax.swing.JButton();
|
||||||
btnSetServer = new javax.swing.JButton();
|
btnSetServer = new javax.swing.JButton();
|
||||||
txtField = new javax.swing.JTextField();
|
|
||||||
btnSend = new javax.swing.JButton();
|
btnSend = new javax.swing.JButton();
|
||||||
lblStatusDialog = new javax.swing.JLabel();
|
lblStatusDialog = new javax.swing.JLabel();
|
||||||
|
jPanel2 = new javax.swing.JPanel();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
jTextArea = new javax.swing.JTextArea();
|
||||||
|
txtField = new javax.swing.JTextField();
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
setTitle("ChatTool");
|
setTitle("ChatTool");
|
||||||
|
|
||||||
jPanel1.setLayout(new java.awt.GridLayout(1, 0));
|
jPanel1.setLayout(new java.awt.GridLayout(1, 0));
|
||||||
|
|
||||||
lblType.setText("Client");
|
|
||||||
jPanel1.add(lblType);
|
jPanel1.add(lblType);
|
||||||
|
|
||||||
btnSetClient.setText("Client");
|
btnSetClient.setText("Client");
|
||||||
@@ -128,18 +135,41 @@ public class ChatView extends javax.swing.JFrame
|
|||||||
|
|
||||||
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
|
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
|
||||||
|
|
||||||
txtField.setText("jTextField1");
|
|
||||||
getContentPane().add(txtField, java.awt.BorderLayout.CENTER);
|
|
||||||
|
|
||||||
btnSend.setText("Send");
|
btnSend.setText("Send");
|
||||||
getContentPane().add(btnSend, java.awt.BorderLayout.LINE_END);
|
getContentPane().add(btnSend, java.awt.BorderLayout.LINE_END);
|
||||||
|
|
||||||
lblStatusDialog.setText("\"\"");
|
lblStatusDialog.setText("\"\"");
|
||||||
getContentPane().add(lblStatusDialog, java.awt.BorderLayout.PAGE_END);
|
getContentPane().add(lblStatusDialog, java.awt.BorderLayout.PAGE_END);
|
||||||
|
|
||||||
|
jPanel2.setLayout(new java.awt.GridLayout(2, 1));
|
||||||
|
|
||||||
|
jTextArea.setEditable(false);
|
||||||
|
jTextArea.setBackground(new java.awt.Color(204, 204, 204));
|
||||||
|
jTextArea.setColumns(20);
|
||||||
|
jTextArea.setRows(5);
|
||||||
|
jScrollPane1.setViewportView(jTextArea);
|
||||||
|
|
||||||
|
jPanel2.add(jScrollPane1);
|
||||||
|
|
||||||
|
txtField.addActionListener(new java.awt.event.ActionListener()
|
||||||
|
{
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt)
|
||||||
|
{
|
||||||
|
txtFieldActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jPanel2.add(txtField);
|
||||||
|
|
||||||
|
getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void txtFieldActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtFieldActionPerformed
|
||||||
|
{//GEN-HEADEREND:event_txtFieldActionPerformed
|
||||||
|
// TODO add your handling code here:
|
||||||
|
}//GEN-LAST:event_txtFieldActionPerformed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
*/
|
*/
|
||||||
@@ -197,8 +227,11 @@ public class ChatView extends javax.swing.JFrame
|
|||||||
private javax.swing.JButton btnSetClient;
|
private javax.swing.JButton btnSetClient;
|
||||||
private javax.swing.JButton btnSetServer;
|
private javax.swing.JButton btnSetServer;
|
||||||
private javax.swing.JPanel jPanel1;
|
private javax.swing.JPanel jPanel1;
|
||||||
|
private javax.swing.JPanel jPanel2;
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JTextArea jTextArea;
|
||||||
private javax.swing.JLabel lblStatusDialog;
|
private javax.swing.JLabel lblStatusDialog;
|
||||||
private javax.swing.JLabel lblType;
|
private javax.swing.JLabel lblType;
|
||||||
private javax.swing.JTextField txtField;
|
private javax.swing.JTextField txtField;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.net.Socket;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import ohmlogger.OhmLogger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builder Class
|
|
||||||
* @author le
|
|
||||||
*/
|
|
||||||
public class Client
|
|
||||||
{
|
|
||||||
private static Logger lg = OhmLogger.getLogger();
|
|
||||||
private static final int PORT = 35000;
|
|
||||||
private static final String IP_ADRESSE = "127.0.0.1";
|
|
||||||
|
|
||||||
public Client() throws IOException
|
|
||||||
{
|
|
||||||
lg.info("Client: verbinde ...");
|
|
||||||
Socket s = new Socket(IP_ADRESSE, PORT); // Achtung: blockiert!
|
|
||||||
lg.info("Client: Verbindung hergestellt");
|
|
||||||
InputStream iStream = s.getInputStream();
|
|
||||||
OutputStream oStream = s.getOutputStream();
|
|
||||||
|
|
||||||
InputStreamReader isr = new InputStreamReader(iStream, "UTF-8");
|
|
||||||
OutputStreamWriter osr = new OutputStreamWriter(oStream, "UTF-8");
|
|
||||||
|
|
||||||
BufferedReader in = new BufferedReader(isr);
|
|
||||||
//BufferedWriter out = new BufferedWriter(osr);
|
|
||||||
PrintWriter out = new PrintWriter(osr);
|
|
||||||
|
|
||||||
lg.info("Client: Stream initialisiert");
|
|
||||||
|
|
||||||
out.println("Hallo Du Server Du - ich bin der client");
|
|
||||||
out.flush(); // wirklich absenden!!
|
|
||||||
|
|
||||||
lg.info("Client: Nachricht versendet");
|
|
||||||
|
|
||||||
String quittung = in.readLine(); // Achtung blockiert
|
|
||||||
lg.info("Client: Quittung empfangen");
|
|
||||||
|
|
||||||
System.out.println("Client: Quittung EMPFANGEN - " + quittung);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
out.close();
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param args the command line arguments
|
|
||||||
*/
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new Client();
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
lg.severe(ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.net.ServerSocket;
|
|
||||||
import java.net.Socket;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import ohmlogger.OhmLogger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builder Class
|
|
||||||
* @author le
|
|
||||||
*/
|
|
||||||
public class Server
|
|
||||||
{
|
|
||||||
private static Logger lg = OhmLogger.getLogger();
|
|
||||||
private static final int PORT = 35000;
|
|
||||||
|
|
||||||
public Server() throws IOException
|
|
||||||
{
|
|
||||||
ServerSocket sSocket = new ServerSocket(PORT);
|
|
||||||
lg.info("Server: Warte auf Verbindung ...");
|
|
||||||
Socket s = sSocket.accept(); // Achtung: blockiert!
|
|
||||||
lg.info("Server: Verbindung akzeptiert");
|
|
||||||
InputStream iStream = s.getInputStream();
|
|
||||||
OutputStream oStream = s.getOutputStream();
|
|
||||||
|
|
||||||
InputStreamReader isr = new InputStreamReader(iStream, "UTF-8");
|
|
||||||
OutputStreamWriter osr = new OutputStreamWriter(oStream, "UTF-8");
|
|
||||||
|
|
||||||
BufferedReader in = new BufferedReader(isr);
|
|
||||||
//BufferedWriter out = new BufferedWriter(osr);
|
|
||||||
PrintWriter out = new PrintWriter(osr);
|
|
||||||
|
|
||||||
lg.info("Server: Stream initialisiert");
|
|
||||||
lg.info("Server: warte auf Nachricht ...");
|
|
||||||
|
|
||||||
String nachricht = in.readLine(); // Achtung blockiert
|
|
||||||
lg.info("Server: Nachricht empfangen");
|
|
||||||
|
|
||||||
System.out.println("Server: NACHRICHT EMPFANGEN - " + nachricht);
|
|
||||||
|
|
||||||
out.println("Server -> ich habe die Nachricht erhalten");
|
|
||||||
lg.info("Server: Quittung versendet");
|
|
||||||
|
|
||||||
out.flush(); // wirklich absenden!!
|
|
||||||
|
|
||||||
out.close();
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param args the command line arguments
|
|
||||||
*/
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new Server();
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
lg.severe(ex.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz;
|
|
||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
import netz.controller.BtnController;
|
|
||||||
import netz.controller.ChatController;
|
|
||||||
import netz.model.ChatModel;
|
|
||||||
import netz.view.ChatView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builder Class
|
|
||||||
* @author chris, hd
|
|
||||||
*/
|
|
||||||
public class Start
|
|
||||||
{
|
|
||||||
public Start() throws MalformedURLException, IOException
|
|
||||||
{
|
|
||||||
// URL oUrl = new URL(urlString + "/" + dateiname);
|
|
||||||
// InputStream iStream = oUrl.openStream();
|
|
||||||
// BufferedInputStream in = new BufferedInputStream(iStream);
|
|
||||||
//
|
|
||||||
// String tmpVerzeichnis = System.getProperty("java.io.tmpdir");
|
|
||||||
// String ausgabeDateiname = tmpVerzeichnis + File.separator + dateiname;
|
|
||||||
//
|
|
||||||
// FileOutputStream fos = new FileOutputStream(ausgabeDateiname);
|
|
||||||
// BufferedOutputStream out = new BufferedOutputStream(fos);
|
|
||||||
//
|
|
||||||
// int wert = 0;
|
|
||||||
//
|
|
||||||
// while ( (wert = in.read()) >= 0)
|
|
||||||
// {
|
|
||||||
// out.write(wert);
|
|
||||||
// }
|
|
||||||
// in.close();
|
|
||||||
// out.close(); // flush!
|
|
||||||
// System.out.println("Datei " + ausgabeDateiname + " erfolgreich erstellt");
|
|
||||||
|
|
||||||
JFrame frm = new JFrame();
|
|
||||||
frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
||||||
|
|
||||||
ChatView view = new ChatView();
|
|
||||||
ChatModel model = new ChatModel();
|
|
||||||
|
|
||||||
BtnController btncontroller = new BtnController(view, model);
|
|
||||||
ChatController chatcontroller = new ChatController(view, model);
|
|
||||||
btncontroller.registerEvents();
|
|
||||||
chatcontroller.registerEvents();
|
|
||||||
|
|
||||||
view.setSize(800, 600);
|
|
||||||
view.setVisible(true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new Start();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
System.err.println(ex);
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new Start();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
System.err.println(ex);
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz.controller;
|
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import netz.model.ChatModel;
|
|
||||||
import netz.view.ChatView;
|
|
||||||
import ohmlogger.OhmLogger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author chris
|
|
||||||
*/
|
|
||||||
public class BtnController implements ActionListener
|
|
||||||
{
|
|
||||||
private ChatView view;
|
|
||||||
private ChatModel model;
|
|
||||||
private static Logger lg = OhmLogger.getLogger();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param view
|
|
||||||
* @param model
|
|
||||||
*/
|
|
||||||
public BtnController(ChatView view, ChatModel model)
|
|
||||||
{
|
|
||||||
this.view = view;
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerEvents()
|
|
||||||
{
|
|
||||||
view.getBtnSetClient().addActionListener(this);
|
|
||||||
view.getBtnSetServer().addActionListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz.controller;
|
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import netz.model.ChatModel;
|
|
||||||
import netz.view.ChatView;
|
|
||||||
import ohmlogger.OhmLogger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author chris
|
|
||||||
*/
|
|
||||||
public class ChatController implements ActionListener
|
|
||||||
{
|
|
||||||
private ChatView view;
|
|
||||||
private ChatModel model;
|
|
||||||
private static Logger lg = OhmLogger.getLogger();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param view
|
|
||||||
* @param model
|
|
||||||
*/
|
|
||||||
public ChatController(ChatView view, ChatModel model)
|
|
||||||
{
|
|
||||||
this.view = view;
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerEvents()
|
|
||||||
{
|
|
||||||
view.getBtnSend().addActionListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package netz.model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author chris
|
|
||||||
*/
|
|
||||||
public class ChatModel
|
|
||||||
{
|
|
||||||
public ChatModel()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
|
||||||
<Properties>
|
|
||||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
|
||||||
</Properties>
|
|
||||||
<SyntheticProperties>
|
|
||||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
|
||||||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
|
||||||
</SyntheticProperties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
|
||||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
</Form>
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package netz.view;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author hd
|
|
||||||
*/
|
|
||||||
public class chatView extends javax.swing.JFrame
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates new form chatView
|
|
||||||
*/
|
|
||||||
public chatView()
|
|
||||||
{
|
|
||||||
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">//GEN-BEGIN:initComponents
|
|
||||||
private void initComponents()
|
|
||||||
{
|
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
|
||||||
|
|
||||||
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, 300, Short.MAX_VALUE)
|
|
||||||
);
|
|
||||||
|
|
||||||
pack();
|
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param args the command line arguments
|
|
||||||
*/
|
|
||||||
public static void main(String args[])
|
|
||||||
{
|
|
||||||
/* Set the Nimbus look and feel */
|
|
||||||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
|
|
||||||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
|
|
||||||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
|
|
||||||
*/
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
|
|
||||||
{
|
|
||||||
if ("Nimbus".equals(info.getName()))
|
|
||||||
{
|
|
||||||
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ClassNotFoundException ex)
|
|
||||||
{
|
|
||||||
java.util.logging.Logger.getLogger(chatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
catch (InstantiationException ex)
|
|
||||||
{
|
|
||||||
java.util.logging.Logger.getLogger(chatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
catch (IllegalAccessException ex)
|
|
||||||
{
|
|
||||||
java.util.logging.Logger.getLogger(chatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
catch (javax.swing.UnsupportedLookAndFeelException ex)
|
|
||||||
{
|
|
||||||
java.util.logging.Logger.getLogger(chatView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
|
||||||
}
|
|
||||||
//</editor-fold>
|
|
||||||
|
|
||||||
/* Create and display the form */
|
|
||||||
java.awt.EventQueue.invokeLater(new Runnable()
|
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
new chatView().setVisible(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
||||||
// End of variables declaration//GEN-END:variables
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#Level
|
|
||||||
LOG_LEVEL=INFO
|
|
||||||
#Log-Datei
|
|
||||||
LOG_DATEI=../logOHM.txt
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#Level
|
|
||||||
LOG_LEVEL=ALL
|
|
||||||
#Log-Datei
|
|
||||||
LOG_DATEI=
|
|
||||||
Reference in new issue
Block a user