ClientSetup.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. import com.ms.wfc.app.*;
  19. import com.ms.wfc.core.*;
  20. import com.ms.wfc.ui.*;
  21. import com.ms.wfc.html.*;
  22. /**
  23. * This class can take a variable number of parameters on the command
  24. * line. Program execution begins with the main() method. The class
  25. * constructor is not invoked unless an object of type 'ClientSetup'
  26. * created in the main() method.
  27. */
  28. public class ClientSetup extends Form
  29. {
  30. public ClientSetup()
  31. {
  32. super();
  33. // Required for Visual J++ Form Designer support
  34. initForm();
  35. // TODO: Add any constructor code after initForm call
  36. }
  37. /**
  38. * ClientSetup overrides dispose so it can clean up the
  39. * component list.
  40. */
  41. public void dispose()
  42. {
  43. super.dispose();
  44. components.dispose();
  45. }
  46. private void okButton_click(Object source, Event e)
  47. {
  48. this.setDialogResult(DialogResult.OK);
  49. }
  50. /**
  51. * NOTE: The following code is required by the Visual J++ form
  52. * designer. It can be modified using the form editor. Do not
  53. * modify it using the code editor.
  54. */
  55. Container components = new Container();
  56. Button okButton = new Button();
  57. GroupBox groupBox1 = new GroupBox();
  58. Label label1 = new Label();
  59. Edit edit1 = new Edit();
  60. Label label2 = new Label();
  61. Edit edit2 = new Edit();
  62. private void initForm()
  63. {
  64. this.setText("Client Setup");
  65. this.setAutoScaleBaseSize(new Point(5, 13));
  66. this.setClientSize(new Point(247, 135));
  67. okButton.setLocation(new Point(168, 104));
  68. okButton.setSize(new Point(75, 23));
  69. okButton.setTabIndex(0);
  70. okButton.setText("Ok");
  71. okButton.addOnClick(new EventHandler(this.okButton_click));
  72. groupBox1.setLocation(new Point(8, 8));
  73. groupBox1.setSize(new Point(232, 88));
  74. groupBox1.setTabIndex(1);
  75. groupBox1.setTabStop(false);
  76. groupBox1.setText("Game Results Server");
  77. label1.setLocation(new Point(8, 24));
  78. label1.setSize(new Point(32, 16));
  79. label1.setTabIndex(0);
  80. label1.setTabStop(false);
  81. label1.setText("Host:");
  82. edit1.setLocation(new Point(40, 24));
  83. edit1.setSize(new Point(184, 20));
  84. edit1.setTabIndex(2);
  85. edit1.setText("games2.westwood.com");
  86. label2.setLocation(new Point(8, 56));
  87. label2.setSize(new Point(32, 16));
  88. label2.setTabIndex(3);
  89. label2.setTabStop(false);
  90. label2.setText("Port:");
  91. edit2.setLocation(new Point(40, 56));
  92. edit2.setSize(new Point(40, 20));
  93. edit2.setTabIndex(1);
  94. edit2.setText("4850");
  95. this.setNewControls(new Control[] {
  96. groupBox1,
  97. okButton});
  98. groupBox1.setNewControls(new Control[] {
  99. edit2,
  100. label2,
  101. edit1,
  102. label1});
  103. }
  104. /**
  105. * The main entry point for the application.
  106. *
  107. * @param args Array of parameters passed to the application
  108. * via the command line.
  109. */
  110. public static void main(String args[])
  111. {
  112. Application.run(new ClientSetup());
  113. }
  114. }