EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


MyIDE

By: darkside  -  Date Submitted: 2010-03-16 23:31:36

  1. import java.io.BufferedReader;
  2. import java.io.File;
  3. import java.io.FileFilter;
  4. import java.io.FileReader;
  5. import java.io.FileWriter;
  6. import java.io.IOException;
  7. import javax.swing.JFileChooser;
  8. import javax.swing.JOptionPane;
  9. import javax.swing.SwingUtilities;
  10.  
  11. /*
  12.  * Face.java
  13.  *
  14.  * Created on Mar 7, 2010, 12:46:03 AM
  15.  */
  16.  
  17. /**
  18.  * My Integrated Development Environment tested on SLAX and Windows XP
  19.  *
  20.  * @author The Son of Man
  21.  * @version 1.0.0.1
  22.  */
  23. public class Face extends javax.swing.JFrame {
  24.  
  25. /** Creates new form Face */
  26.  
  27. public String curFile, gcc = "/usr/bin/gcc", cc = "/usr/bin/cc", product, _os, titleBar, defaultTitle;
  28. public JFileChooser fChooser;
  29. public boolean cFile, isLinux;
  30.  
  31. public Face() {
  32. initComponents();
  33.  
  34. String nameOS = "os.name";
  35. this._os = System.getProperty(nameOS);
  36.  
  37. this.defaultTitle = "MyIDE" + "@" + this._os + ": ";
  38.  
  39. this.titleBar = this.defaultTitle;
  40.  
  41. setTitle(this.titleBar);
  42.  
  43. if (this._os.equals("Linux")) {
  44. this.isLinux = true;
  45. } else {
  46. this.gccField.setText("specify");
  47. this.parameterField.setText("specify");
  48. this.isLinux = false;
  49. }
  50.  
  51. this.setResizable(false);
  52.  
  53. this.cFile = false;
  54. this.curFile = null;
  55. this.fChooser = new JFileChooser();
  56. this.product = null;
  57. }
  58.  
  59. /** This method is called from within the constructor to
  60.   * initialize the form.
  61.   * WARNING: Do NOT modify this code. The content of this method is
  62.   * always regenerated by the Form Editor.
  63.   */
  64. @SuppressWarnings("unchecked")
  65. // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  66. private void initComponents() {
  67.  
  68. contentPanel = new javax.swing.JPanel();
  69. menuPanel = new javax.swing.JPanel();
  70. parameterField = new javax.swing.JTextField();
  71. fileNameField = new javax.swing.JTextField();
  72. gccField = new javax.swing.JTextField();
  73. gccLabel = new javax.swing.JLabel();
  74. paramLabel = new javax.swing.JLabel();
  75. fileNameLabel = new javax.swing.JLabel();
  76. l_label = new javax.swing.JLabel();
  77. lCount = new javax.swing.JLabel();
  78. pathLabel = new javax.swing.JLabel();
  79. pathField = new javax.swing.JTextField();
  80. shButton = new javax.swing.JButton();
  81. scrollPane = new javax.swing.JScrollPane();
  82. _textArea = new javax.swing.JTextArea();
  83. menuBar = new javax.swing.JMenuBar();
  84. fileMenu = new javax.swing.JMenu();
  85. openMenuItem = new javax.swing.JMenuItem();
  86. saveMenuItem = new javax.swing.JMenuItem();
  87. closeMenuItem = new javax.swing.JMenuItem();
  88. fileSeparator = new javax.swing.JPopupMenu.Separator();
  89. exitMenuItem = new javax.swing.JMenuItem();
  90. codeMenu = new javax.swing.JMenu();
  91. compileMenuItem = new javax.swing.JMenuItem();
  92. cnrMenuItem = new javax.swing.JMenuItem();
  93. aboutMenu = new javax.swing.JMenu();
  94. myIDEMenuItem = new javax.swing.JMenuItem();
  95.  
  96. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  97. setTitle("MyIDE");
  98. setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
  99. getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  100.  
  101. contentPanel.setBorder(new javax.swing.border.MatteBorder(null));
  102.  
  103. menuPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
  104.  
  105. parameterField.setText("-Wall -o");
  106. parameterField.setToolTipText("Parameters for the compiler. Default: -Wall -o");
  107.  
  108. fileNameField.setText("myapp");
  109. fileNameField.setToolTipText("The filename to save the file as.");
  110.  
  111. gccField.setText("/usr/bin/g++");
  112. gccField.setToolTipText("The location of the gcc, g++, or cc compiler in your system.");
  113.  
  114. gccLabel.setText("gcc location");
  115.  
  116. paramLabel.setText("parameters");
  117.  
  118. fileNameLabel.setText("filename");
  119.  
  120. l_label.setText("line count:");
  121.  
  122. lCount.setText("0");
  123.  
  124. pathLabel.setText("program path");
  125.  
  126. pathField.setText("specify");
  127. pathField.setToolTipText("The path to save the file to.");
  128.  
  129. shButton.setText("shell");
  130. shButton.setToolTipText("Opens a shell.");
  131. shButton.addActionListener(new java.awt.event.ActionListener() {
  132. public void actionPerformed(java.awt.event.ActionEvent evt) {
  133. shButtonActionPerformed(evt);
  134. }
  135. });
  136.  
  137. javax.swing.GroupLayout menuPanelLayout = new javax.swing.GroupLayout(menuPanel);
  138. menuPanel.setLayout(menuPanelLayout);
  139. menuPanelLayout.setHorizontalGroup(
  140. menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  141. .addGroup(menuPanelLayout.createSequentialGroup()
  142. .addContainerGap()
  143. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  144. .addComponent(gccLabel)
  145. .addComponent(gccField, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
  146. .addGroup(menuPanelLayout.createSequentialGroup()
  147. .addComponent(l_label)
  148. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  149. .addComponent(lCount)))
  150. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  151. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  152. .addComponent(parameterField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
  153. .addComponent(paramLabel))
  154. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  155. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  156. .addComponent(fileNameLabel)
  157. .addComponent(fileNameField, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE))
  158. .addGap(12, 12, 12)
  159. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  160. .addGroup(menuPanelLayout.createSequentialGroup()
  161. .addComponent(pathField, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
  162. .addContainerGap())
  163. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, menuPanelLayout.createSequentialGroup()
  164. .addComponent(shButton, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
  165. .addContainerGap())
  166. .addGroup(menuPanelLayout.createSequentialGroup()
  167. .addComponent(pathLabel)
  168. .addGap(27, 27, 27))))
  169. );
  170. menuPanelLayout.setVerticalGroup(
  171. menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  172. .addGroup(menuPanelLayout.createSequentialGroup()
  173. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  174. .addComponent(gccLabel)
  175. .addComponent(paramLabel)
  176. .addComponent(fileNameLabel)
  177. .addComponent(pathLabel))
  178. .addGap(3, 3, 3)
  179. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  180. .addComponent(gccField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  181. .addComponent(parameterField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  182. .addComponent(fileNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  183. .addComponent(pathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  184. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  185. .addGroup(menuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  186. .addComponent(l_label)
  187. .addComponent(lCount)
  188. .addComponent(shButton, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
  189. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  190. );
  191.  
  192. _textArea.setColumns(20);
  193. _textArea.setRows(5);
  194. _textArea.addCaretListener(new javax.swing.event.CaretListener() {
  195. public void caretUpdate(javax.swing.event.CaretEvent evt) {
  196. _textAreaCaretUpdate(evt);
  197. }
  198. });
  199. scrollPane.setViewportView(_textArea);
  200.  
  201. javax.swing.GroupLayout contentPanelLayout = new javax.swing.GroupLayout(contentPanel);
  202. contentPanel.setLayout(contentPanelLayout);
  203. contentPanelLayout.setHorizontalGroup(
  204. contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  205. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
  206. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  207. .addComponent(menuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  208. .addContainerGap())
  209. .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)
  210. );
  211. contentPanelLayout.setVerticalGroup(
  212. contentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  213. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
  214. .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)
  215. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  216. .addComponent(menuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  217. .addContainerGap())
  218. );
  219.  
  220. getContentPane().add(contentPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 550, 610));
  221.  
  222. fileMenu.setText("File");
  223. fileMenu.setToolTipText("");
  224.  
  225. openMenuItem.setText("Open a file");
  226. openMenuItem.setToolTipText("Open an already written file for editing purposes, etc.");
  227. openMenuItem.addActionListener(new java.awt.event.ActionListener() {
  228. public void actionPerformed(java.awt.event.ActionEvent evt) {
  229. openMenuItemActionPerformed(evt);
  230. }
  231. });
  232. fileMenu.add(openMenuItem);
  233.  
  234. saveMenuItem.setText("Save current file");
  235. saveMenuItem.setToolTipText("Save this file for future usage, etc.");
  236. saveMenuItem.addActionListener(new java.awt.event.ActionListener() {
  237. public void actionPerformed(java.awt.event.ActionEvent evt) {
  238. saveMenuItemActionPerformed(evt);
  239. }
  240. });
  241. fileMenu.add(saveMenuItem);
  242.  
  243. closeMenuItem.setText("Close this file");
  244. closeMenuItem.setToolTipText("Close this file to begin coding something else, etc.");
  245. closeMenuItem.addActionListener(new java.awt.event.ActionListener() {
  246. public void actionPerformed(java.awt.event.ActionEvent evt) {
  247. closeMenuItemActionPerformed(evt);
  248. }
  249. });
  250. fileMenu.add(closeMenuItem);
  251. fileMenu.add(fileSeparator);
  252.  
  253. exitMenuItem.setText("Exit");
  254. exitMenuItem.setToolTipText("This will close the application.");
  255. exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
  256. public void actionPerformed(java.awt.event.ActionEvent evt) {
  257. exitMenuItemActionPerformed(evt);
  258. }
  259. });
  260. fileMenu.add(exitMenuItem);
  261.  
  262. menuBar.add(fileMenu);
  263.  
  264. codeMenu.setText("Code");
  265. codeMenu.setToolTipText("");
  266.  
  267. compileMenuItem.setText("Compile");
  268. compileMenuItem.setToolTipText("Compiles the file. Be sure to check it out with the shell button.");
  269. compileMenuItem.addActionListener(new java.awt.event.ActionListener() {
  270. public void actionPerformed(java.awt.event.ActionEvent evt) {
  271. compileMenuItemActionPerformed(evt);
  272. }
  273. });
  274. codeMenu.add(compileMenuItem);
  275.  
  276. cnrMenuItem.setText("Compile & Run");
  277. cnrMenuItem.setToolTipText("Compiles the file and executes it afterward.");
  278. cnrMenuItem.addActionListener(new java.awt.event.ActionListener() {
  279. public void actionPerformed(java.awt.event.ActionEvent evt) {
  280. cnrMenuItemActionPerformed(evt);
  281. }
  282. });
  283. codeMenu.add(cnrMenuItem);
  284.  
  285. menuBar.add(codeMenu);
  286.  
  287. aboutMenu.setText("About");
  288. aboutMenu.setToolTipText("");
  289.  
  290. myIDEMenuItem.setText("MyIDE");
  291. myIDEMenuItem.setToolTipText("Usage/Author information.");
  292. myIDEMenuItem.addActionListener(new java.awt.event.ActionListener() {
  293. public void actionPerformed(java.awt.event.ActionEvent evt) {
  294. myIDEMenuItemActionPerformed(evt);
  295. }
  296. });
  297. aboutMenu.add(myIDEMenuItem);
  298.  
  299. menuBar.add(aboutMenu);
  300.  
  301. setJMenuBar(menuBar);
  302.  
  303. pack();
  304. }// </editor-fold>//GEN-END:initComponents
  305.  
  306. private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
  307. try {
  308. if (this.cFile == false) {
  309. String lines = "";
  310. int returnval = this.fChooser.showOpenDialog(this);
  311. File file = this.fChooser.getSelectedFile();
  312.  
  313. if (returnval == JFileChooser.APPROVE_OPTION) {
  314. try {
  315. FileReader fRead = new FileReader(file.getPath());
  316. BufferedReader fData = new BufferedReader(fRead);
  317. boolean eof = false;
  318.  
  319. while (!eof) {
  320. String line = fData.readLine();
  321.  
  322. if (line != null) lines += (line+"\r\n");
  323. else eof = true;
  324. }
  325.  
  326. fData.close();
  327. } catch (IOException e) {
  328. String _message = "Could not open the file.", _title = "Error";
  329. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  330. }
  331. this.cFile = true;
  332. this.curFile = file.getPath();
  333. this.setTitleBar(this.curFile);
  334. this._textArea.setText(lines);
  335. }
  336. } else {
  337. String _message = "Please (save and) close the current file first.", _title = "Error";
  338. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  339. }
  340. } catch (NullPointerException exc) {
  341. String _message = "Please (save and) close the current file first.", _title = "Error";
  342. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  343. }
  344. }//GEN-LAST:event_openMenuItemActionPerformed
  345.  
  346. private void saveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveMenuItemActionPerformed
  347. int returnval = this.fChooser.showSaveDialog(this);
  348. File file = this.fChooser.getSelectedFile();
  349.  
  350. this._textArea.append("\n"); // for gcc purposes
  351.  
  352. if (returnval == JFileChooser.APPROVE_OPTION) {
  353. try {
  354. String fData = this._textArea.getText();
  355. this.curFile = file.getPath();
  356. FileWriter out = new FileWriter(this.curFile);
  357. out.write(fData);
  358. out.close();
  359. } catch (IOException e) {
  360. String _message = "The file could not be saved.", _title = "Error";
  361. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  362. }
  363. }
  364. this.cFile = true;
  365. this.setTitleBar(this.curFile);
  366. }//GEN-LAST:event_saveMenuItemActionPerformed
  367.  
  368. private void closeMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeMenuItemActionPerformed
  369. try {
  370. if (this.cFile == true) {
  371. this.curFile.equals(null);
  372. this.setTitleBar("");
  373. this.cFile = false;
  374. this._textArea.setText("");
  375. } else if (!(this._textArea.getText().isEmpty())) {
  376. this._textArea.setText("");
  377. } else {
  378. String _message = "No text to clear.", _title = "Error";
  379. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  380. }
  381. } catch (NullPointerException exc) {
  382. String _message = "No text to clear.", _title = "Error";
  383. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  384. }
  385. }//GEN-LAST:event_closeMenuItemActionPerformed
  386.  
  387. private void setTitleBar(String _curFile)
  388. {
  389. this.titleBar = this.defaultTitle + _curFile;
  390. setTitle(this.titleBar);
  391. }
  392.  
  393. private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
  394. this.dispose();
  395. System.exit(0);
  396. }//GEN-LAST:event_exitMenuItemActionPerformed
  397.  
  398. private void compileMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_compileMenuItemActionPerformed
  399. try {
  400. if (this.cFile == true) {
  401. if (!(this.gccField.getText().equals(null)) &&
  402. !(this.parameterField.getText().equals(null)) &&
  403. !(this.fileNameField.getText().equals(null)) &&
  404. !(this.pathField.getText().equals(null))) {
  405. try {
  406. String cmd = this.gccField.getText() +
  407. " " +
  408. this.parameterField.getText() +
  409. " " +
  410. this.pathField.getText() + this.fileNameField.getText() +
  411. " " +
  412. this.curFile;
  413. Process compileProc = Runtime.getRuntime().exec(cmd);
  414. } catch (IOException ex) {
  415. String _message = "Could not compile.", _title = "Error";
  416. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  417. }
  418. } else {
  419. String _message = "Fill out each text field first.", _title = "Error";
  420. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  421. }
  422. } else {
  423. String _message = "Save the file first or choose a file.", _title = "Error";
  424. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  425. }
  426. } catch (NullPointerException exc) {
  427. String _message = "Fill out each text field first.", _title = "Error";
  428. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  429. }
  430. }//GEN-LAST:event_compileMenuItemActionPerformed
  431.  
  432. private void cnrMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cnrMenuItemActionPerformed
  433. try {
  434. if (this.cFile == true) {
  435. if (!(this.gccField.getText().equals(null)) &&
  436. !(this.parameterField.getText().equals(null)) &&
  437. !(this.fileNameField.getText().equals(null)) &&
  438. !(this.pathField.getText().equals(null))) {
  439.  
  440. try {
  441. String cmd = this.gccField.getText() +
  442. " " +
  443. this.parameterField.getText() +
  444. " " +
  445. this.pathField.getText() + this.fileNameField.getText() +
  446. " " +
  447. this.curFile;
  448. Process compileProc = Runtime.getRuntime().exec(cmd);
  449. } catch (IOException ex) {
  450. String _message = "Could not compile.", _title = "Error";
  451. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  452. }
  453.  
  454. this.product.equals(this.fileNameField.getText());
  455. this.pathField.setText(this.product);
  456. File wd = new File("/usr/bin");
  457. String sh_cmd = "/usr/bin/xterm" + " " + this.pathField.getText() + this.fileNameField.getText();
  458.  
  459. try {
  460. Process execProc = Runtime.getRuntime().exec(sh_cmd, null, wd);
  461. } catch (IOException exc) {
  462. String _message = "Could not execute the compilation.\n\n" + exc.getMessage(), _title = "Error";
  463. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  464. }
  465. } else {
  466. String _message = "Fill out each text field first.", _title = "Error";
  467. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  468. }
  469. } else {
  470. String _message = "Save the file first or choose a file.", _title = "Error";
  471. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  472. }
  473. } catch (NullPointerException exc) {
  474. String _message = "Fill out each text field first.", _title = "Error";
  475. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  476. }
  477. }//GEN-LAST:event_cnrMenuItemActionPerformed
  478.  
  479. private void myIDEMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_myIDEMenuItemActionPerformed
  480. String _message = "I wrote this program because I seriously couldn't find a C++ IDE for Linux.\n" +
  481. "MyIDE is a simple, platform-independent application written with Java Technology.\n" +
  482. "\nInstructions:\n" +
  483. "Specify location of gcc\n" +
  484. "Specify gcc parameters\n" +
  485. "Specify compilation file name\n" +
  486. "Specify path to save file to" +
  487. "\n\nAuthor: The Son of Man" +
  488. "\nEMail: 6461726B73696465@gmail.com", _title = "About MyIDE";
  489. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.INFORMATION_MESSAGE);
  490. }//GEN-LAST:event_myIDEMenuItemActionPerformed
  491.  
  492. private void shButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shButtonActionPerformed
  493. File wd = new File("/usr/bin");
  494.  
  495. if (this.isLinux == true) {
  496. String cmd = "/usr/bin/xterm";
  497. try {
  498. p = Runtime.getRuntime().exec(cmd, null, wd);
  499. } catch (IOException ex) {
  500. String _message = "Couldn't open bash.", _title = "Error";
  501. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  502. }
  503. } else if (this.isLinux == false) {
  504. String cmd = "C:\\WINDOWS\\system32\\cmd.exe";
  505. try {
  506. p = Runtime.getRuntime().exec(cmd);
  507. } catch (IOException exc) {
  508. String _message = "Couldn't open command prompt.", _title = "Error";
  509. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  510. }
  511. } else {
  512. String _message = "You must manually open your shell.", _title = "Error";
  513. JOptionPane.showMessageDialog(null, _message, _title, JOptionPane.ERROR_MESSAGE);
  514. }
  515. }//GEN-LAST:event_shButtonActionPerformed
  516.  
  517. private void _textAreaCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event__textAreaCaretUpdate
  518. int count = this._textArea.getLineCount();
  519. this.lCount.setText(String.valueOf(count));
  520. }//GEN-LAST:event__textAreaCaretUpdate
  521.  
  522. /**
  523.   * @param args the command line arguments
  524.   */
  525. public static void main(String args[]) {
  526. java.awt.EventQueue.invokeLater(new Runnable() {
  527. public void run() {
  528. new Face().setVisible(true);
  529. }
  530. });
  531. }
  532.  
  533. // Variables declaration - do not modify//GEN-BEGIN:variables
  534. private javax.swing.JTextArea _textArea;
  535. private javax.swing.JMenu aboutMenu;
  536. private javax.swing.JMenuItem closeMenuItem;
  537. private javax.swing.JMenuItem cnrMenuItem;
  538. private javax.swing.JMenu codeMenu;
  539. private javax.swing.JMenuItem compileMenuItem;
  540. private javax.swing.JPanel contentPanel;
  541. private javax.swing.JMenuItem exitMenuItem;
  542. private javax.swing.JMenu fileMenu;
  543. private javax.swing.JTextField fileNameField;
  544. private javax.swing.JLabel fileNameLabel;
  545. private javax.swing.JPopupMenu.Separator fileSeparator;
  546. private javax.swing.JTextField gccField;
  547. private javax.swing.JLabel gccLabel;
  548. private javax.swing.JLabel lCount;
  549. private javax.swing.JLabel l_label;
  550. private javax.swing.JMenuBar menuBar;
  551. private javax.swing.JPanel menuPanel;
  552. private javax.swing.JMenuItem myIDEMenuItem;
  553. private javax.swing.JMenuItem openMenuItem;
  554. private javax.swing.JLabel paramLabel;
  555. private javax.swing.JTextField parameterField;
  556. private javax.swing.JTextField pathField;
  557. private javax.swing.JLabel pathLabel;
  558. private javax.swing.JMenuItem saveMenuItem;
  559. private javax.swing.JScrollPane scrollPane;
  560. private javax.swing.JButton shButton;
  561. // End of variables declaration//GEN-END:variables
  562.  
  563. }
  564.  
Return to java category list

Who Visited EnigmaGroup Today?

1504 Guests, 297 Users (189 Spiders)
mongrel88, Taireegaddita, Taicadine, theanonymous21, alexelixir, c_a13, Abhinav2107, hizImmoli, scifics, slchill, spartanvedicrishi, KELATALFTUS, kynapse, Tonyui, Hackpad, Epilioptiop, VireekadiaFap, Mamorite, IodindDog, brunoriversyhn, Effomeidonize, ReottphoffBom, arktek, burgeoningneophyte, TradaGreant, SlayingDragons, Waldlyeps, Arsenal, CJ_Omaha, CreedoFiegree, Ryuske, thethird3y3, todayadvila, pwnpwnlolz, NeetaexomYgom, ookami-namikaze, dot_Cipher, Unotohumsmush, SaubymorRoyab, bivaEmilltite, loltyg, Ausome1, Rik, hrangel, cyber-guard, Meonkzt, mori, 31415926, optioniLele, intorerse, FlifobbyFloks, Ios, saraf, Røgue, cossyDrybrich, IvanDimitriev, havisham, KIKNWING, fitz, fleeloCycle, hackboy302, strudels, CootoDorbeeft, gymnediny, hustleman9tv, comando300, Ysri13, thatoneguy, Paran0id, whoami, Pitanteerve, r0z4, Reapon, cls777, myfabregas, Afrika, suetekh, somebody777, floontiny, Frudopvia, jasonbourne, zombiehack640, CloverCipher, spoosh, Fraubbova, rulebreaker, dncjor, obencefoozy, Fintyoptots, viRuleNt, NipPaineHainy, TheHarrisonW, Jamesgo, TheGanjator, psychomarine, 1421carter, tingle65, claudius, Feld Grau, Partisan, Gunslinger, gydeqqzpn, yshiau, Zaccarato, chromoSone, priovasashCor, ellisp, GothicLogic, keetone, M0rdak, UsedDeteKef, nhorton, archestraty, HatriteBeft, JC06dc5, alpha1, spg, dark_void, wakazi, mtroscheck, TheCheeseDemon, ach.n30, sahariar, hervelegeraf, Psiber_Syn, hackaday, Mod777, neompenly, pollolololo, SnoopSky, Cigmimifs, DrOptix, ProloG-Shaman, unicornrainbow, cheapnikeshoxog, bobsters, foofthoorgo, polemarchos, avacraft, spencerwilliams23, lotato, ryanjcrook, dollerolf, robintenboden, rospark, WexEmbet, BeefSupreme, Hessesian, whydoyoulook, cdpirate, DnA-Ender, CaNcEr, zheincnoob, Vengeance987, justforfun363, RawTeefecycle, Squissesk, aVoid, SaMTHG, neodude, Marion1p, Ops, ddxc, BlAd373, Klosse, khamhou, samsatHD80, PauffPubadvic, AnnaNoult, SexyCreerve, newb1, robster1977, Blizer, Dudleypagrove, Mr_KaLiMaN, FirewallPenetrator, GMo, Seasharp, mrchicken1, Zaxem, N4g4c3N, MaxMeier, Ian, sander.ashwin, Predatorc, lonely.connection, ElEnfermado, wavyd, dirkdanblue, cve916, drag0n, kalak55, a1los, jell0, Exclaw, veceattainc, Muselele, Mr Pacifist, stylish007, zach, litbk, closednetwork99, soroimmuror, memoryshot, PlaneReaction, Wamemanytex38, DieAble, d0seN_36b, jeremy.whitson, lol, nefeolnb, Noticon, statix, anandoump, RomeoG, advilapyday, snorapa, Gkjt, autotuneuser, beanulpinee, 2142, kiklopas, door51, Pizza, deepakkumar, makler2004, M4rcy, Xargos, bdkoenig, Blavatsky, m4f10, Huasca, itsme, xu_lain, Nikhil, ChewBigRed, samxoxo, incicaMaidits, toudioria, Chidokage, Jigoku, cesecyclelm, schn1ffl3r, sam20000, learning, kentora, San Marino, Nightraven, zanydouner, FrofErrodslot, FatalEror, wheaties, akki, AlexDiru, unclejos666, override101, blink_212, uncowstientee, lilkpoigogs, Innonaenupt607, Killshot, ZheIncKnight, ActictGlync, acarseflalk, ___, trashsporn, Memartent, Zoorsornaks, z3z3, heyhey123, Ghajnm, usaliaPels, Ordeptpen, pelly, quellense, Szuba, nmobin27, lamb, x1rt4m, ToutousaRulty, vipervince2002, mannavard1611, BinaryShinigami, Duchdund, afgnumgt, Anatissa, greatg, darkfire1515, bennyblanco5000, Mmmett50, ToryLogsEsoff, impalwinona, Kelsfednege, ensubbrut, ant0601, Alpha0mega, pbarwim
 
Enigma Group