Ajout des fichiers restants

This commit is contained in:
Olivier DOSSMANN
2008-06-04 12:03:04 +02:00
parent 48ff5f7c7a
commit 6dc3725ec8
30 changed files with 10484 additions and 0 deletions

142
P51/PopupConnectionBD.java Normal file
View File

@ -0,0 +1,142 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class PopupConnectionBD extends JDialog {
JPanel mainPanel;
JPanel labelPanel;
JPanel fieldPanel;
JPanel buttonPanel;
JPanel textPanel;
JButton buttonOK;
JButton buttonCancel;
JPasswordField passwordField;
JTextField nameField;
JLabel nameLabel;
JLabel passwordLabel;
JLabel baseLabel;
JTextField baseField;
JLabel hostLabel;
JLabel portLabel;
JTextField hostField;
JTextField portField;
private String name;
private String password;
private String base;
private String host;
private String port;
public JFrame parentFrame;
public String getHost() {
return host ;
}
public String getPort() {
return port ;
}
public String getUserName() {
return name ;
}
public String getUserPassword() {
return password;
}
public String getDataBase() {
return base;
}
public PopupConnectionBD( JFrame frame, String popupName ) {
super( (Frame)frame, popupName, true );
parentFrame = frame;
name = new String( "" );
password = new String( "" );
base = new String( "" );
host = new String( "" );
port = new String( "" );
fieldPanel = new JPanel();
fieldPanel.setLayout( new GridLayout( 5, 1 ) );
labelPanel = new JPanel();
labelPanel.setLayout( new GridLayout( 5, 1 ) );
hostField = new JTextField( "grive", 12 );
hostLabel = new JLabel( "Serveur : " );
labelPanel.add( hostLabel );
fieldPanel.add( hostField );
portField = new JTextField( "1521", 12 );
portLabel = new JLabel( "Port : " );
labelPanel.add( portLabel );
fieldPanel.add( portField );
baseField = new JTextField( "v816", 12 );
baseLabel = new JLabel( "Base : " );
labelPanel.add( baseLabel );
fieldPanel.add( baseField );
nameField = new JTextField( 12 );
nameLabel = new JLabel( "Nom : " );
labelPanel.add( nameLabel );
fieldPanel.add( nameField );
passwordLabel = new JLabel( "Mot de passe : " );
passwordField = new JPasswordField( 12 );
labelPanel.add( passwordLabel );
fieldPanel.add( passwordField );
textPanel = new JPanel();
textPanel.setLayout( new FlowLayout() );
textPanel.add( labelPanel );
textPanel.add( fieldPanel );
buttonPanel = new JPanel();
buttonPanel.setLayout( new GridLayout( 1, 2 ) );
buttonOK = new JButton( "OK" );
buttonOK.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent ev ) {
base = baseField.getText();
password = new String( passwordField.getPassword() );
name = nameField.getText();
passwordField.setText( "" );
nameField.setText( "" );
setVisible( false );
parentFrame.pack();
}
}
);
buttonCancel = new JButton( "Annuler" );
buttonCancel.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent ev ) {
name = "";
password = "";
base = "";
passwordField.setText( "" );
nameField.setText( "" );
setVisible( false );
parentFrame.pack();
}
}
);
buttonPanel.add( buttonOK );
buttonPanel.add( buttonCancel );
mainPanel = new JPanel();
mainPanel.setLayout( new BorderLayout() );
mainPanel.add( textPanel, BorderLayout.CENTER );
mainPanel.add( buttonPanel, BorderLayout.SOUTH );
getContentPane().add( mainPanel );
//setSize( 250, 130 );
setVisible( false );
pack();
setResizable( false );
}
}

77
P51/PopupRequestBD.java Normal file
View File

@ -0,0 +1,77 @@
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
class PopupRequestBD extends JDialog
{
JPanel mainPanel;
JPanel buttonPanel;
JPanel requestPanel;
JButton buttonOK;
JButton buttonCancel;
JLabel requestLabel;
JScrollPane requestScroll;
JTextArea requestArea;
private String query;
public JFrame parentFrame;
public String getQuery() {
return query ;
}
public PopupRequestBD( JFrame frame, String popupName ) {
super( (Frame)frame, popupName, true );
parentFrame = frame;
query = new String( "" );
requestArea = new JTextArea( "", 20, 4 );
requestLabel = new JLabel( "Entrez votre requ<71>te :" );
requestScroll = new JScrollPane( requestArea );
requestPanel = new JPanel();
requestPanel.setLayout( new BorderLayout() );
requestPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder( Color.black, 1 ),
BorderFactory.createEmptyBorder( 2, 2, 2, 2 )));
requestPanel.add( requestLabel, BorderLayout.NORTH );
requestPanel.add( requestScroll, BorderLayout.CENTER );
buttonPanel = new JPanel();
buttonPanel.setLayout( new GridLayout( 1, 2 ) );
buttonOK = new JButton( "OK" );
buttonOK.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent ev ) {
query = requestArea.getText();
setVisible( false );
parentFrame.pack();
}
}
);
buttonCancel = new JButton( "Annuler" );
buttonCancel.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent ev ) {
query = "";
setVisible( false );
parentFrame.pack();
}
}
);
buttonPanel.add( buttonOK );
buttonPanel.add( buttonCancel );
mainPanel = new JPanel();
mainPanel.setLayout( new BorderLayout() );
mainPanel.add( requestPanel, BorderLayout.CENTER );
mainPanel.add( buttonPanel, BorderLayout.SOUTH );
getContentPane().add( mainPanel );
setSize( 350, 160 );
setVisible( false );
//setResizable( false );
}
}