Himekp

ProRocktails

May 18th, 2011
1,681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.06 KB | None | 0 0
  1. /* ---- Made by Himekp ----
  2. * The Current Version is V1.30
  3. */
  4.  
  5. import java.awt.Color;
  6. import java.awt.Container;
  7. import java.awt.Dimension;
  8. import java.awt.Font;
  9. import java.awt.Insets;
  10. import java.awt.Point;
  11. import java.awt.Rectangle;
  12. import java.awt.event.ActionEvent;
  13. import java.awt.event.ActionListener;
  14.  
  15. import javax.swing.DefaultComboBoxModel;
  16. import javax.swing.JButton;
  17. import javax.swing.JComboBox;
  18. import javax.swing.JFrame;
  19. import javax.swing.JLabel;
  20. import javax.swing.JPanel;
  21. import javax.swing.JSlider;
  22. import javax.swing.JTextField;
  23.  
  24. import org.rsbot.script.Script;
  25. import org.rsbot.script.ScriptManifest;
  26. import org.rsbot.script.wrappers.RSArea;
  27. import org.rsbot.script.wrappers.RSNPC;
  28. import org.rsbot.script.wrappers.RSObject;
  29. import org.rsbot.script.wrappers.RSPath;
  30. import org.rsbot.script.wrappers.RSTile;
  31.  
  32. @ScriptManifest(authors = "Himekp", keywords = "Fishing", name = "ProRocktails, By: Himekp", version = 1.30, description = "To check for Updates, Right click me!", website = "http://dl.dropbox.com/u/27626614/ProFisher.java")
  33. public class ProRocktails extends Script {
  34. private String TypeofFish = "";
  35. private String Banking = "";
  36. private boolean startScript;
  37. boolean start;
  38. public boolean guiWait = true, guiExit = false;
  39. ProFisherGUI gui;
  40. public int feather = 314;
  41. public int rod = 309;
  42. private int rocksspot = 8842;
  43. private int cavesspot = 8841;
  44. private int rocksbank = 45079;
  45. public boolean startrunning = false;
  46. public boolean hpresting = false;
  47. private int mouseSpeed;
  48. public int[] dontDrop = { 309, 314, 303, 311, 301, 360, 372, 378, 305, 307, 313, 11323, 14109, 15263 };
  49. private int[] fishingAnim = { 622, 623, 621, 619, 618, 620, 5108, 9980, 6708, 14723, 6711, 10617 };
  50. public int myhp = 0;
  51. public int hitpoints = 300;
  52. public boolean restup = false;
  53. public int amount = 200;
  54. public int[] rocksstuff = { 15263, 307 };
  55. public int[] cavestuff = { 380, 307 };
  56. private int laddermines = 30942;
  57. private int rockmines = 45077;
  58. public int bait = 15263;
  59. public int cavebait = 380;
  60.  
  61. public void drop() {
  62. inventory.dropAllExcept(dontDrop);
  63. }
  64. public boolean onStart(){
  65. log(Color.blue, "Welcome to Himekp's AIO ProRocktails");
  66. log(Color.red, "Check for updates by right clicking my script!");
  67. log(Color.red, "Then check the version and if it isn't V1.30 then theres an update! Recopy and recompile!");
  68. log("Loading GUI...Please wait...");
  69. gui = new ProFisherGUI();
  70. gui.setVisible(true);
  71. log(Color.green, "The higher the Mouse Speed number is, the faster your mouse will be! Speed 6 is recomended!");
  72. startScript = true;
  73. while (!startScript) {
  74. sleep(10);
  75. }
  76. return true;
  77. }
  78.  
  79. public void onFinish(){
  80. log("Thank You!");
  81. }
  82.  
  83. public boolean walktomines2() {
  84. if(!atmines2()) {
  85. RSPath path = walking.newTilePath(gotomines2);
  86. path.traverse();
  87. }
  88. return true;
  89. }
  90.  
  91. private boolean walktomines(){
  92. if(!atmines()) {
  93. RSPath path = walking.newTilePath(gotomines);
  94. path.traverse();
  95. }
  96. return true;
  97. }
  98.  
  99. public boolean atdraynorrocks() {
  100. RSArea area = new RSArea(new RSTile(3081,3484), new RSTile(3102, 3507));
  101. return area.contains(getMyPlayer().getLocation());
  102. }
  103.  
  104. public boolean atmines() {
  105. RSArea area = new RSArea(new RSTile(3011,3445), new RSTile(3024, 3453));
  106. return area.contains(getMyPlayer().getLocation());
  107. }
  108.  
  109. public boolean atsecondarymines() {
  110. RSArea area = new RSArea(new RSTile(3000,9818), new RSTile(3033, 9860));
  111. return area.contains(getMyPlayer().getLocation());
  112. }
  113.  
  114. public boolean atmines2() {
  115. RSArea area = new RSArea(new RSTile(3010,9830), new RSTile(3016, 9833));
  116. return area.contains(getMyPlayer().getLocation());
  117. }
  118.  
  119. public boolean getstuff(){
  120. if (!bank.isOpen()) {
  121. bank.open();
  122. if(!inventory.contains(rod)){
  123. bank.withdraw(rod, 1);
  124. }
  125. if(!inventory.contains(bait)){
  126. bank.withdraw(bait, amount);
  127. }
  128. bank.close();
  129. } else {
  130. if (bank.isOpen())
  131. if(!inventory.contains(rod)){
  132. bank.withdraw(rod, 1);
  133. }
  134. if(!inventory.contains(bait)){
  135. bank.withdraw(bait, amount);
  136. }
  137. bank.close();
  138. sleep (50,400);
  139. }
  140. return true;
  141. }
  142.  
  143. public boolean getstuffcaves(){
  144. if (!bank.isOpen()) {
  145. bank.open();
  146. if(!inventory.contains(rod)){
  147. bank.withdraw(rod, 1);
  148. }
  149. if(!inventory.contains(cavebait)){
  150. bank.withdraw(cavebait, amount);
  151. }
  152. bank.close();
  153. } else {
  154. if (bank.isOpen())
  155. if(!inventory.contains(rod)){
  156. bank.withdraw(rod, 1);
  157. }
  158. if(!inventory.contains(cavebait)){
  159. bank.withdraw(cavebait, amount);
  160. }
  161. bank.close();
  162. sleep (50,400);
  163. }
  164. return true;
  165. }
  166.  
  167. @SuppressWarnings("deprecation")
  168. public boolean climb(){
  169. RSObject Ladder = objects.getNearest(laddermines);
  170. if (Ladder != null) {
  171. if (calc.distanceTo(Ladder) <= 4) {
  172. Ladder.doAction("Climb");
  173. sleep(800, 2400);
  174. } else if (calc.distanceTo(Ladder) > 4) {
  175. walking.walkTo(Ladder.getLocation());
  176. sleep(800, 2600);
  177. }
  178. }
  179. return true;
  180. }
  181.  
  182. @SuppressWarnings("deprecation")
  183. public boolean climb2(){
  184. RSObject Ladder = objects.getNearest(rockmines);
  185. if (Ladder != null) {
  186. if (calc.distanceTo(Ladder) <= 4) {
  187. Ladder.doAction("Climb");
  188. sleep(800, 2400);
  189. } else if (calc.distanceTo(Ladder) > 4) {
  190. walking.walkTo(Ladder.getLocation());
  191. sleep(800, 2600);
  192. }
  193. }
  194. return true;
  195. }
  196.  
  197. public int loop(){
  198. for (int i : fishingAnim) {
  199. if (getMyPlayer().getAnimation() == i) {
  200. sleep(100, 250);
  201. }
  202. if(getMyPlayer().isInCombat()){
  203. walktobankfromrocks();
  204. }
  205. if(myhp() < hitpoints){
  206. restup = true;
  207. }
  208. if(myhp() > hitpoints){
  209. restup = false;
  210. }
  211. if(restup == true){
  212. if(atrocksBank()){
  213. if(getMyPlayer().getAnimation() == -1){
  214. rest();
  215. sleep(1000);
  216. }else{
  217. sleep(500);
  218. }
  219. }else{
  220. walktobankfromrocks();
  221. }
  222. }
  223. else if(restup == false){
  224. if(TypeofFish.equals("Rocktails")){
  225. if(atdraynorrocks() && inventory.getCount(bait) <= 3 && inventory.contains(rod)){
  226. getstuff();
  227. }
  228. if(game.getPlane() == 0 && inventory.containsAll(rocksstuff)){
  229. walktomines();
  230. }
  231. if(atmines()){
  232. climb();
  233. }
  234. if(!atmines2() && atsecondarymines()){
  235. walktomines2();
  236. }
  237. if(atmines2()){
  238. climb2();
  239. sleep(2000);
  240. }
  241. if(Banking.equals("Drop")){
  242. if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
  243. drop();
  244. }
  245. }
  246. if(Banking.equals("Bank")){
  247. if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
  248. bankrocks();
  249. }
  250. else if(!inventory.isFull() && !atrocks() && !getMyPlayer().isInCombat()) {
  251. walktorocksfrombank();
  252. }
  253. }
  254. if (!inventory.isFull() && !getMyPlayer().isInCombat() && atrocks()) {
  255. fishrocks();
  256. }
  257. }
  258. if(TypeofFish.equals("Cavefish")){
  259. if(atdraynorrocks() && inventory.getCount(cavebait) <= 5 && inventory.contains(rod)){
  260. getstuffcaves();
  261. }
  262. if(game.getPlane() == 0 && inventory.containsAll(cavestuff)){
  263. walktomines();
  264. }
  265. if(atmines()){
  266. climb();
  267. }
  268. if(!atmines2() && atsecondarymines()){
  269. walktomines2();
  270. }
  271. if(atmines2()){
  272. climb2();
  273. sleep(2000);
  274. }
  275. if(Banking.equals("Drop")){
  276. if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
  277. drop();
  278. }
  279. }
  280. if(Banking.equals("Bank")){
  281. if (inventory.isFull() && getMyPlayer().getAnimation() == -1){
  282. bankrocks();
  283. }
  284. else if(!inventory.isFull() && !atrocks() && !getMyPlayer().isInCombat()) {
  285. walktorocksfrombank();
  286. }
  287. }
  288. if (!inventory.isFull() && !getMyPlayer().isInCombat() && atrocks()) {
  289. fishcaves();
  290. }
  291. }
  292. }
  293. }
  294. enableRun();
  295. sleep(100);
  296. mouse.setSpeed(mouseSpeed);
  297. return 100;
  298. }
  299.  
  300. public void enableRun() {
  301. if (walking.getEnergy() > random(50, 100)
  302. && settings.getSetting(173) != 1) {
  303. walking.setRun(true);
  304. sleep(1000, 2000);
  305. }
  306. }
  307.  
  308. @SuppressWarnings("deprecation")
  309. public boolean fishcaves() {
  310. if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) {
  311. RSNPC Spot = npcs.getNearest(cavesspot); // Finds nearest
  312. // fishing spot by ID
  313. if (Spot != null) {
  314. if (Spot.isOnScreen()) {
  315. camera.turnTo(Spot);
  316. Spot.doAction("Bait");
  317. sleep(800, 2400);
  318. } else if (!Spot.isOnScreen()) {
  319. walking.walkTo(Spot.getLocation());
  320. sleep(800, 2600);
  321. }
  322. }
  323. }
  324. return true;
  325. }
  326.  
  327. @SuppressWarnings("deprecation")
  328. public boolean fishrocks() {
  329. if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) {
  330. RSNPC Spot = npcs.getNearest(rocksspot); // Finds nearest
  331. // fishing spot by ID
  332. if (Spot != null) {
  333. if (Spot.isOnScreen()) {
  334. camera.turnTo(Spot);
  335. Spot.doAction("Bait");
  336. sleep(800, 2400);
  337. } else if (!Spot.isOnScreen()) {
  338. walking.walkTo(Spot.getLocation());
  339. sleep(800, 2600);
  340. }
  341. }
  342. }
  343. return true;
  344. }
  345.  
  346. public boolean bankrocks() {
  347. if (inventory.isFull() && !atrocksBank()) {
  348. walktobankfromrocks();
  349. }
  350. else if(inventory.isFull() && atrocksBank()) {
  351. depositrocks();
  352. }
  353. return true;
  354. }
  355.  
  356. public boolean atrocksBank() {
  357. RSArea area = new RSArea(new RSTile(3650,5112), new RSTile(3657, 5116));
  358. return area.contains(getMyPlayer().getLocation());
  359. }
  360.  
  361. public boolean atrocks() {
  362. RSArea area = new RSArea(new RSTile(3642,5079), new RSTile(3658, 5087));
  363. return area.contains(getMyPlayer().getLocation());
  364. }
  365.  
  366. RSTile[] gotorocksbank = { new RSTile(3018, 3450), new RSTile(3023, 3459),
  367. new RSTile(3031, 3467), new RSTile(3044, 3472),
  368. new RSTile(3056, 3473), new RSTile(3065, 3485),
  369. new RSTile(3065, 3497), new RSTile(3073, 3502),
  370. new RSTile(3087, 3498), new RSTile(3094, 3493) };
  371.  
  372. RSTile[] gotorocks = { new RSTile(3094, 3493), new RSTile(3087, 3498),
  373. new RSTile(3073, 3502), new RSTile(3065, 3497),
  374. new RSTile(3065, 3485), new RSTile(3056, 3473),
  375. new RSTile(3044, 3472), new RSTile(3031, 3467),
  376. new RSTile(3044, 3472), new RSTile(3031, 3467),
  377. new RSTile(3023, 3459), new RSTile(3018, 3450) };
  378.  
  379. RSTile[] gotomines = { new RSTile(3092, 3502), new RSTile(3088, 3503),
  380. new RSTile(3084, 3504), new RSTile(3079, 3504),
  381. new RSTile(3074, 3506), new RSTile(3070, 3510),
  382. new RSTile(3064, 3510), new RSTile(3063, 3505),
  383. new RSTile(3063, 3500), new RSTile(3063, 3496),
  384. new RSTile(3063, 3491), new RSTile(3063, 3486),
  385. new RSTile(3063, 3481), new RSTile(3057, 3478),
  386. new RSTile(3055, 3473), new RSTile(3053, 3469),
  387. new RSTile(3047, 3470), new RSTile(3041, 3471),
  388. new RSTile(3035, 3471), new RSTile(3031, 3468),
  389. new RSTile(3026, 3466), new RSTile(3024, 3463),
  390. new RSTile(3021, 3460), new RSTile(3019, 3456),
  391. new RSTile(3015, 3455), new RSTile(3017, 3450) };
  392.  
  393. RSTile[] gotomines2 = { new RSTile(3020, 9848), new RSTile(3020, 9844),
  394. new RSTile(3019, 9841), new RSTile(3019, 9837),
  395. new RSTile(3019, 9833), new RSTile(3016, 9832),
  396. new RSTile(3012, 9830) };
  397.  
  398. private RSTile safespot = new RSTile(3654, 5113);
  399.  
  400. public boolean walktobankfromrocks() {
  401. if(!atrocksBank()) {
  402. RSPath path = walking.newTilePath(gotorocks);
  403. path.traverse();
  404. }
  405. return true;
  406. }
  407.  
  408. private boolean walktorocksfrombank(){
  409. if(!atrocks()) {
  410. RSPath path = walking.newTilePath(gotorocksbank);
  411. path.traverse();
  412. }
  413. return true;
  414. }
  415.  
  416. @SuppressWarnings("deprecation")
  417. public boolean depositrocks() {
  418. RSObject Lift = objects.getNearest(rocksbank);
  419. if (Lift != null) {
  420. if (calc.distanceTo(Lift) <= 4) {
  421. Lift.doAction("Deposit");
  422. if (!interfaces.get(11).isValid()) {
  423. sleep(800, 2400);
  424. }
  425. if (interfaces.get(11).isValid()) {
  426. bank.depositAllExcept(dontDrop);
  427. }
  428. sleep(800, 2400);
  429. } else if (calc.distanceTo(Lift) > 4) {
  430. walking.walkTo(Lift.getLocation());
  431. sleep(800, 2600);
  432. }
  433. }
  434. return true;
  435. }
  436.  
  437. public int myhp(){
  438. if (interfaces.get(748).getComponent(8).isValid()) {
  439. myhp = Integer.parseInt(interfaces.get(748).getComponent(8).getText());
  440. }
  441. return myhp;
  442. }
  443.  
  444. public boolean rest(){
  445. return true;
  446. }
  447.  
  448. public boolean runfromCombat() {
  449. if (getMyPlayer().isInCombat()) {
  450. startrunning = true;
  451. if (calc.distanceTo(safespot) > 4) {
  452. walktobankfromrocks();
  453. }else{
  454. rest();
  455. hpresting = true;
  456. }
  457. }
  458. else if(!getMyPlayer().isInCombat() && (myhp() > hitpoints)){
  459. hpresting = false;
  460. }
  461. return true;
  462. }
  463.  
  464.  
  465. public class ProFisherGUI extends JPanel {
  466. private static final long serialVersionUID = 1L;
  467. public ProFisherGUI() {
  468. initComponents();
  469. }
  470.  
  471. private void button1ActionPerformed(ActionEvent e) {
  472. TypeofFish = comboBox2.getSelectedItem().toString();
  473. Banking = comboBox3.getSelectedItem().toString();
  474. mouseSpeed = slider1.getValue();
  475. hitpoints = Integer.parseInt(textField1.getText());
  476. amount = Integer.parseInt(textField2.getText());
  477.  
  478. if (slider1.getValue() == 10) {
  479. mouseSpeed = 1;
  480. } else if (slider1.getValue() == 9) {
  481. mouseSpeed = 2;
  482. } else if (slider1.getValue() == 8) {
  483. mouseSpeed = 3;
  484. } else if (slider1.getValue() == 7) {
  485. mouseSpeed = 4;
  486. } else if (slider1.getValue() == 6) {
  487. mouseSpeed = 5;
  488. } else if (slider1.getValue() == 5) {
  489. mouseSpeed = 6;
  490. } else if (slider1.getValue() == 4) {
  491. mouseSpeed = 7;
  492. } else if (slider1.getValue() == 3) {
  493. mouseSpeed = 8;
  494. } else if (slider1.getValue() == 2) {
  495. mouseSpeed = 9;
  496. } else if (slider1.getValue() == 1) {
  497. mouseSpeed = 10;
  498. } else if (slider1.getValue() == 0) {
  499. mouseSpeed = 11;
  500. }
  501. start = true;
  502. guiWait = false;
  503. frame1.dispose();
  504. }
  505.  
  506. private void initComponents() {
  507. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  508. frame1 = new JFrame();
  509. label1 = new JLabel();
  510. label2 = new JLabel();
  511. label3 = new JLabel();
  512. comboBox1 = new JComboBox();
  513. label4 = new JLabel();
  514. comboBox2 = new JComboBox();
  515. comboBox3 = new JComboBox();
  516. label5 = new JLabel();
  517. button1 = new JButton();
  518. slider1 = new JSlider();
  519. label6 = new JLabel();
  520. label7 = new JLabel();
  521. textField1 = new JTextField("300");
  522. textField2 = new JTextField("200");
  523. label8 = new JLabel();
  524. label9 = new JLabel();
  525. label10 = new JLabel();
  526.  
  527. //======== frame1 ========
  528. {
  529. Container frame1ContentPane = frame1.getContentPane();
  530. frame1ContentPane.setLayout(null);
  531. frame1.setVisible(true);
  532. frame1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  533.  
  534.  
  535. //---- label1 ----
  536. label1.setText("ProFisher");
  537. label1.setFont(new Font("Aerosol", Font.BOLD, 48));
  538. frame1ContentPane.add(label1);
  539. label1.setBounds(10, 5, 275, 50);
  540.  
  541. //---- label2 ----
  542. label2.setText("By: Himekp");
  543. label2.setFont(new Font("Aerosol", Font.PLAIN, 36));
  544. frame1ContentPane.add(label2);
  545. label2.setBounds(55, 45, 220, 40);
  546.  
  547. //---- label3 ----
  548. label3.setText("Location:");
  549. label3.setEnabled(false);
  550. label3.setFont(new Font("Tahoma", Font.PLAIN, 22));
  551. frame1ContentPane.add(label3);
  552. label3.setBounds(10, 95, 95, 30);
  553.  
  554. //---- label4 ----
  555. label4.setText("Type of Fish:");
  556. label4.setFont(new Font("Tahoma", Font.PLAIN, 22));
  557. label4.setEnabled(false);
  558. frame1ContentPane.add(label4);
  559. label4.setBounds(10, 130, 135, 30);
  560.  
  561. //---- label5 ----
  562. label5.setText("Banking:");
  563. label5.setEnabled(false);
  564. label5.setFont(new Font("Tahoma", Font.PLAIN, 22));
  565. frame1ContentPane.add(label5);
  566. label5.setBounds(10, 165, 95, 30);
  567.  
  568. //---- button1 ----
  569. button1.setText("Start");
  570. button1.addActionListener(new ActionListener() {
  571. @Override
  572. public void actionPerformed(ActionEvent e) {
  573. button1ActionPerformed(e);
  574. }
  575. });
  576. button1.setFont(new Font("Tahoma", Font.PLAIN, 26));
  577. frame1ContentPane.add(button1);
  578. button1.setBounds(5, 380, 275, 100);
  579.  
  580. //---- comboBox1 ----
  581. frame1ContentPane.add(comboBox1);
  582. comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  583. "Living Rock Caverns"
  584. }));
  585. comboBox1.setBounds(105, 95, 170, 30);
  586.  
  587. //---- comboBox2 ----
  588. frame1ContentPane.add(comboBox2);
  589. comboBox2.setModel(new DefaultComboBoxModel(new String[] {
  590. "Rocktails",
  591. "Cavefish"
  592. }));
  593. comboBox2.setBounds(145, 130, 130, 30);
  594.  
  595. //---- comboBox3 ----
  596. frame1ContentPane.add(comboBox3);
  597. comboBox3.setModel(new DefaultComboBoxModel(new String[] {
  598. "Bank",
  599. "Drop"
  600. }));
  601. comboBox3.setBounds(105, 165, 170, 30);
  602.  
  603. //---- slider1 ----
  604. slider1.setMajorTickSpacing(1);
  605. slider1.setSnapToTicks(true);
  606. slider1.setPaintTicks(true);
  607. slider1.setPaintLabels(true);
  608. slider1.setMaximum(10);
  609. frame1ContentPane.add(slider1);
  610. slider1.setBounds(10, 230, 265, 40);
  611.  
  612. //---- label6 ----
  613. label6.setText("Mouse Speed:");
  614. label6.setFont(new Font("Tahoma", Font.PLAIN, 22));
  615. label6.setEnabled(false);
  616. frame1ContentPane.add(label6);
  617. label6.setBounds(70, 200, 140, 30);
  618.  
  619. //---- label7 ----
  620. label7.setText("HP to heal at:");
  621. label7.setEnabled(false);
  622. label7.setFont(new Font("Tahoma", Font.PLAIN, 16));
  623. frame1ContentPane.add(label7);
  624. label7.setBounds(10, 310, 115, 26);
  625.  
  626. //---- textfield1 ----
  627. frame1ContentPane.add(textField1);
  628. textField1.setBounds(30, 355, 55, textField1.getPreferredSize().height);
  629.  
  630. //---- label8 ----
  631. label8.setText("Rockfish/Cavefish Settings");
  632. label8.setEnabled(false);
  633. label8.setFont(new Font("Tahoma", Font.PLAIN, 18));
  634. frame1ContentPane.add(label8);
  635. label8.setBounds(new Rectangle(new Point(40, 280), label8.getPreferredSize()));
  636.  
  637. //---- label9 ----
  638. label9.setText("Living Rock Material");
  639. label9.setEnabled(false);
  640. label9.setFont(new Font("Tahoma", Font.PLAIN, 16));
  641. frame1ContentPane.add(label9);
  642. label9.setBounds(135, 310, label9.getPreferredSize().width, 25);
  643.  
  644. //---- textField2 ----
  645. frame1ContentPane.add(textField2);
  646. textField2.setBounds(180, 355, 55, textField2.getPreferredSize().height);
  647.  
  648. //---- label10 ----
  649. label10.setText("Withdraw(If Dead)");
  650. label10.setEnabled(false);
  651. label10.setFont(new Font("Tahoma", Font.PLAIN, 14));
  652. frame1ContentPane.add(label10);
  653. label10.setBounds(new Rectangle(new Point(155, 335), label10.getPreferredSize()));
  654.  
  655.  
  656.  
  657. { // compute preferred size
  658. Dimension preferredSize = new Dimension();
  659. for(int i = 0; i < frame1ContentPane.getComponentCount(); i++) {
  660. Rectangle bounds = frame1ContentPane.getComponent(i).getBounds();
  661. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  662. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  663. }
  664. Insets insets = frame1ContentPane.getInsets();
  665. preferredSize.width += insets.right;
  666. preferredSize.height += insets.bottom;
  667. frame1ContentPane.setMinimumSize(preferredSize);
  668. frame1ContentPane.setPreferredSize(preferredSize);
  669. }
  670. frame1.pack();
  671. frame1.setLocationRelativeTo(frame1.getOwner());
  672. }
  673. // JFormDesigner - End of component initialization //GEN-END:initComponents
  674. }
  675.  
  676. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  677. private JFrame frame1;
  678. private JLabel label1;
  679. private JLabel label2;
  680. private JLabel label3;
  681. private JComboBox comboBox1;
  682. private JLabel label4;
  683. private JComboBox comboBox2;
  684. private JComboBox comboBox3;
  685. private JLabel label5;
  686. private JButton button1;
  687. private JSlider slider1;
  688. private JLabel label6;
  689. private JLabel label7;
  690. private JTextField textField1;
  691. private JTextField textField2;
  692. private JLabel label8;
  693. private JLabel label9;
  694. private JLabel label10;
  695. // JFormDesigner - End of variables declaration //GEN-END:variables
  696. }
  697. }
Advertisement
Add Comment
Please, Sign In to add comment