[Commit] RRClient RRClient.java,1.10,1.11
Bart Massey
commit at keithp.com
Sat Jul 5 01:31:45 PDT 2003
Committed by: bart
Update of /local/src/CVS/RRClient
In directory home.keithp.com:/tmp/cvs-serv30664
Modified Files:
RRClient.java
Log Message:
Finally got the layout right. Ripped out some applet stuff:
will put back when known how.
Index: RRClient.java
===================================================================
RCS file: /local/src/CVS/RRClient/RRClient.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- RRClient.java 5 Jul 2003 07:15:34 -0000 1.10
+++ RRClient.java 5 Jul 2003 07:31:42 -0000 1.11
@@ -10,6 +10,7 @@
*/
import javax.swing.*;
+import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
@@ -17,43 +18,6 @@
public class RRClient extends JApplet {
- public void init() {
- Socket s;
- try {
- s = new Socket("localhost", 5252);
- } catch (UnknownHostException e) {
- System.err.println("unknown host");
- return;
- } catch (IOException e) {
- System.err.println("connection error");
- return;
- }
- final RRController ctl = new RRController();
- try {
- ctl.netout = new RRNetOut(s, ctl);
- ctl.board = new RRBoard(ctl, null);
- ctl.images = new RRImages(this);
- ctl.boardPanel = new RRBoardPanel(ctl);
- ctl.netin = new RRNetIn(s, ctl);
- } catch (IOException e) {
- System.err.println("could not connect to host");
- return;
- }
- String[] intstrings = {"3", "4", "5", "6", "7", "8", "9", "10"};
- JComboBox bidPanel = new JComboBox(intstrings);
- class BidListener implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- JComboBox b = (JComboBox) e.getSource();
- ctl.netout.bid(Integer.parseInt((String)(b.getSelectedItem())) + 3);
- }
- };
- BidListener bid_listener = new BidListener();
- bidPanel.addActionListener(bid_listener);
- getContentPane().add(bidPanel, BorderLayout.EAST);
- getContentPane().add(ctl.boardPanel, BorderLayout.CENTER);
- ctl.netin.start();
- }
-
public static void main(String[] args)
throws IOException {
if (args.length != 4) {
@@ -79,7 +43,7 @@
JComboBox bidBox = new JComboBox(intstrings);
bidBox.setEditable(true);
bidBox.setSelectedItem("");
- bidBox.setMaximumRowCount(3);
+ /* bidBox.setMaximumRowCount(3); */
bidBox.setMaximumSize(bidBox.getPreferredSize());
class BidListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
@@ -89,9 +53,15 @@
};
BidListener bid_listener = new BidListener();
bidBox.addActionListener(bid_listener);
+
+ JPanel bx = new JPanel();
+ bx.add(bidBox);
+ Border border = BorderFactory.createTitledBorder(null, "Bid");
+ bx.setBorder(border);
+ bx.setMaximumSize(bx.getPreferredSize());
Box bidPanel = new Box(BoxLayout.Y_AXIS);
- bidPanel.add(bidBox);
+ bidPanel.add(bx);
f.getContentPane().add(bidPanel, BorderLayout.EAST);
f.setSize(new Dimension(596, 496));
More information about the Commit
mailing list