Jump to content

Search the Community

Showing results for tags 'gui'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 24 results

  1. Hey, so I tried making my own little RSPS by following the RuneLocus 'How to make a RuneScape private server' tutorial. Everything worked perfectly fine until I got to step #4. Everytime I try to open the run.bat in the Client folder (from the RuneLocus Starter Kit) the cmd pops up and says Could not find or load main class GUI. Press any key to continue. I'm completely new to all of this and I've searched for about an hour for help and nothing even fits my situation. Someone pleaseee please help me, I will very much appreciate it. And keep in mind that I'm a beginner, so if you will, please 'dumb it down' for me. Thanks!
  2. Okay, my problem is that I have GUI and I want to have a method that I can use that'll update the JTextArea with the new string. But I keep getting this error [code] Exception in thread "main" java.lang.NullPointerException at text.gui.GUI.updateTextArea(GUI.java:138) at text.game.Test.intro(Test.java:10) at text.gui.GUI.main(GUI.java:50) [/code] Here's all the code I have that involves the text area, am I missing something, I don't know what's wrong. [code]private JTextArea textArea;[/code] [code] public static void main(String[] args) { /*try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { GUI frame = new GUI(); Test.intro(); } });*/ GUI frame = new GUI(); frame.setVisible(true); Test.intro(); }[/code] [code] final JTextArea textArea = new JTextArea(); textArea.setBackground(new Color(176, 224, 230)); scrollPane.setViewportView(textArea); textArea.setEditable(false);[/code] [code] textField.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if(e.getKeyCode() == KeyEvent.VK_ENTER) { inputString = textField.getText(); textArea.append(inputString+"\n"); textField.setText(""); } } });[/code] [code] public void updateTextArea(String message) { textArea.append(textArea.getText() + message + "\n"); textArea.selectAll(); int x = textArea.getSelectionEnd(); textArea.select(x, x); }[/code] [code]public class Test { static GUI frame = new GUI(); public static void intro() { frame.updateTextArea("Testing"); } }[/code] :confused:
  3. EDIT: FIXED. Remove please, thanks for nobody helping me. After my thread being up for 2 days. Remind me never to use Runelocus forums again. Not even one reply.
  4. I don't know what's wrong, my GUI is fine, I know I've set up the launch code correctly, but it's just not running when I run the server. [code]package com.rs2hd; import com.rs2hd.model.Player; import com.rs2hd.model.World; /** * * [MENTION=52317]auth[/MENTION]or Divine-X * */ [MENTION=19271]supp[/MENTION]ressWarnings("serial") public class DivineFramework extends javax.swing.JFrame { /** * Class Constructor */ public DivineFramework() { initComponents(); setSize(450, 300); setResizable(false); } private void initComponents() { jTabbedPane = new javax.swing.JTabbedPane(1); contentPane = new javax.swing.JLayeredPane(); sendMessageButton = new javax.swing.JButton(); announceMentJTF = new javax.swing.JTextField(); messageJTF = new javax.swing.JTextField(); setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("Divine Framework"); this.contentPane = new javax.swing.JLayeredPane(); this.contentPane.setBorder(new javax.swing.border.EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); jPanel1 = new javax.swing.JPanel(); jPanel1.setBounds(0, 0, 450, 300); this.contentPane.add(jPanel1); jPanel1.setLayout(new java.awt.BorderLayout(0, 0)); jPanel1.add(jTabbedPane); jPanel1 = new javax.swing.JPanel(); jTabbedPane.addTab("Main", null, jPanel1, null); jPanel1.add(sendMessageButton); jPanel1.add(announceMentJTF); jPanel1.add(messageJTF); jPanel1.setLayout(null); /** * Text field */ announceMentJTF.setText("[Announcement]"); announceMentJTF.setFont(new java.awt.Font("Rockwell", 1, 12)); announceMentJTF.setBounds(65, 10, 300, 25); messageJTF.setText("Message"); messageJTF.setFont(new java.awt.Font("Rockwell", 1, 12)); messageJTF.setBounds(65, 40, 300, 25); /** * Button Handling */ sendMessageButton.setText("Send Message"); sendMessageButton.setBounds(145, 70, 130, 25); sendMessageButton.setFont(new java.awt.Font("Rockwell", 1, 12)); sendMessageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sendMessageButtonActionPerformed(evt); } }); } /** * Button Effects * [MENTION=75098]Para[/MENTION]m evt */ protected void sendMessageButtonActionPerformed(java.awt.event.ActionEvent evt) { String preText = announceMentJTF.getText(); String yellText = messageJTF.getText(); for (Player p : World.getInstance().getPlayerList()) { p.getActionSender().sendMessage((new StringBuilder()).append(preText).append(": ").append(yellText).toString()); } } /** * [MENTION=75098]Para[/MENTION]m args the command line arguments */ public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new DivineFramework().setVisible(true); } }); } //Declared variables do not modify private javax.swing.JTabbedPane jTabbedPane; private javax.swing.JLayeredPane contentPane; private javax.swing.JButton sendMessageButton; private javax.swing.JPanel jPanel1; private javax.swing.JTextField messageJTF; private javax.swing.JTextField announceMentJTF; //End of variable declarations }][/code] [code]package com.rs2hd; import java.io.File; [COLOR="#FF0000"]import com.rs2hd.DivineFramework;[/COLOR] import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.rs2hd.content.LoadPrices; import com.rs2hd.content.ShopHandler; import com.rs2hd.content.Shops; import com.rs2hd.content.minigames.BHWorld; import com.rs2hd.content.skills.combat.NpcVsPlayer; import com.rs2hd.content.skills.fishing.FishSpotLive; import com.rs2hd.content.skills.mining.RockLive; import com.rs2hd.content.skills.prayer.Prayer; import com.rs2hd.content.skills.summoning.Summon; import com.rs2hd.content.skills.thief.StallLive; import com.rs2hd.content.skills.woodcutting.TreeLive; import com.rs2hd.content.ClanChat.ClanMain; import com.rs2hd.content.ClanChat.SaveChats; //import com.rs2hd.content.grandexchange.*; import com.rs2hd.content.LoadEquips; import com.rs2hd.io.MapDataLoader; import com.rs2hd.io.MapDataPacker; import com.rs2hd.io.XStreamPlayerLoader; import com.rs2hd.model.ItemDefinition; import com.rs2hd.model.NPCDefinition; import com.rs2hd.model.World; import com.rs2hd.model.clipInfo; import com.rs2hd.model.NoclipHandler; import com.rs2hd.packethandler.PacketHandlers; import com.rs2hd.util.BanUser; import com.rs2hd.util.Censor; import com.rs2hd.util.MuteUser; import com.rs2hd.util.AddTile; import com.rs2hd.util.Scripts; import com.rs2hd.content.*; import com.rs2hd.model.NPC; import com.rs2hd.util.PathFinder.*; import com.rs2hd.util.pathfinding.*; import com.rs2hd.util.log.Logger; import com.rs2hd.util.WorldList; import com.rs2hd.util.AutoSaveEvent; import com.rs2hd.tools.*; /** * A varek has called it before, the 'central motor' of the game. * * That means it handles periodic updating and packet handling/creation. * * [MENTION=52317]auth[/MENTION]or Graham * */ public class GameEngine { public static ClanMain ClanMain = new ClanMain(); private static SaveChats save; public static boolean DarkCoreOn = false; /** * Logger instance. */ private Logger logger = Logger.getInstance(); /** * Running flag. */ private boolean isRunning; /** * Poison */ public static Poison poison = new Poison(); /** * This makes you wish that Java supported typedefs. */ private Map<Integer, int[]> mapData; /** * Our worker thread. */ private WorkerThread workerThread; /** * Handles player some classes by Dragonkk */ public static LoadEquips equip = new LoadEquips(); public static FishSpotLive FishSpotLive = new FishSpotLive(); //rocks public static StallLive StallLive = new StallLive(); //stalls public static RockLive RockLive = new RockLive(); //rocks public static TreeLive TreeLive = new TreeLive(); //trees public static MuteUser mute = new MuteUser(); //loads muted users public static AddTile AddTile = new AddTile(); //loads muted users public static BanUser ban = new BanUser(); //loads banned users public static Censor Censor = new Censor(); //load bad words public static LoadPrices prices = new LoadPrices(); //prices public static Shops shops = new Shops(); //load shops stuff public static ShopHandler shopHandler = new ShopHandler(); //shops configs public static NpcVsPlayer nvp = new NpcVsPlayer(); //nvp public static Prayer prayer = new Prayer(); //pray not needed to be here public static Summon summon = new Summon(); //not needed soon wil remove public static BHWorld BH = new BHWorld(); //bh //public static clipInfo clipInfo = new clipInfo(); //bh public static NoclipHandler clipInfo = new NoclipHandler(); //bh /** * Thread group. */ public ThreadGroup threads = new ThreadGroup("Project Skux"); /** * Creates other things vital to the game logic, like the world class. * @throws Exception */ public GameEngine() throws Exception { /* * We are running. */ isRunning = true; /* * Check if mapdata packed file exists, if not, then we pack it. */ File packedFile = new File("data/mapdata/packed.dat"); if(!packedFile.exists()) { MapDataPacker.pack("data/mapdata/unpacked/", "data/mapdata/packed.dat"); } packedFile = new File("data/clip/packed.dat"); //ItemXmlToBinary.main(null); /* * Actually load the mapdata. */ mapData = new HashMap<Integer, int[]>(); MapDataLoader.load(mapData); /* * Load handlers. */ PacketHandlers.loadHandlers(); /* * Load item definitions. */ logger.info("Loading item definitions..."); ItemDefinition.load(); logger.info("Loading npc definitions..."); NPCDefinition.load(); setSave(new SaveChats()); setSave(null); logger.info("Setting up world..."); World.getInstance().setEngine(this); logger.info("Loading world list data..."); WorldList worldList = new WorldList(); worldList.load(); //GUI Start [COLOR="#FF0000"] logger.info("Launching GUI..."); initComponents = new DivineFramework();[/COLOR] //GUI End logger.info("Launching worker thread..."); workerThread = new WorkerThread(new XStreamPlayerLoader()); newThread("WorkerThread", workerThread); Scripts.init(); } public void newThread(String name, Runnable r) { try { new Thread(threads, r, name).start(); } catch(Exception e) { } } [COLOR="#FF0000"]public static DivineFramework initComponents = null;[/COLOR] /** * Handle a major update. */ public void majorUpdate() { try { World.getInstance().majorUpdate(); } catch(Exception e) { } } /** * Handle a minor update. */ public void minorUpdate() { try { //mn.Restarter(); //World.getInstance().minorUpdate(); } catch(Exception e) { } } /** * Called every tick. */ public void tick() { try { World.getInstance().tick(); } catch(Exception e) { } } /** * Gets the is running flag. * @return */ public boolean isRunning() { return isRunning; } /** * Sets the is running flag. * [MENTION=75098]Para[/MENTION]m isRunning */ public void setIsRunning(boolean isRunning) { try { this.isRunning = isRunning; } catch(Exception e) { } } /** * Gets the worker thread. * @return */ public WorkerThread getWorkerThread() { return workerThread; } /** * Stops threads, saves games, etc. */ public void cleanup() { try { threads.interrupt(); } catch(Exception e) { } } public int[] getMapData(int region) { return mapData.get(region); } public static void setSave(SaveChats save) { GameEngine.save = save; } public static SaveChats getSave() { return save; } } [/code]
  5. Hi all, Yesterday I finnally got my server online and I could play on it ^^ But... :( after I edited some things to npc's and shops I tried to run server and client (I'm still using Runelocus starters pack :D) Now I got the same error as I got earlier [B]"could not find or load main class .GUI"[/B]. I checked my PATH and CLASSPATH again and they were ok on both system and user variables. Can somebody help me again please? :D
  6. When my friends try to run my server it says: cannot find class path: gui Can someone tell me how to fix this? they said that the file: gui is still in there but i have no clue how to fix this. Please help.
  7. [IMG]http://i45.tinypic.com/23u9aqb.png[/IMG] I know where the problem is at but its not letting me use my real server ip i need that there to run it becasue 127.0.0.1 wont work only that one... can someone help me please like teamviewer or something?
  8. hellppppp!!! please
  9. poop

    Client... plz help

    Caused by: Java.lang.ClassNotFoundException: EGUI at Java.net.URLClassLoader$1.run<Unknown Source> at Java,security.AccessController.do<Unknown Source> at Java.net.URLClassLoader.findClass<Unknown Source> at Java.lang.ClassLoader.loadClass<Unknown Source> at Java.misc.Launcher$AppClassLoader.loadClass<Unknown Source> at java.lang.ClassLoader.LoadClass<Unknown Source> Could not find the main class: EGUI. Program will exit. That's the error people receive when they click Run on my client... Why? It works perfectly fine on my computer, but on others' it doesn't.
  10. Anyone knows a good GUI builder plugin for Eclipse? I don't like NetBeans' one and need suggestions.
  11. I'm using Divinity which is a project insanity source and I keep getting this error whenever i try to run the client... the cache came seperate from the client and i put it in my c drive. I get this error: [IMG]http://i43.tinypic.com/lh1zo.png[/IMG] Also this is what i have in the run file: @echo off title Client cd ./Class/ "C:\Program Files (x86)\Java\jre6\bin\java.exe" -Xmx500m Gui 30 0 lowmem members 32 pause Here is a picture of my java folder too: [IMG]http://i42.tinypic.com/2nufdi.png[/IMG] Can someone please help me with this?? If it is something to do with the cache can you please explain to me where to put the cache folder? Thanks Found a small error: i changed my jre6 to jre7 and i got this error now: [IMG]http://i39.tinypic.com/11jbr6f.png[/IMG]
  12. I run my client and it comes up with an error saying "Could not find the mainclass Gui." it never used to do this before, i get the error when i change the localhost to my ip.
  13. This is a very well written .pdf. Lots of examples and it will give you a good overview of the things you can do with a GUI in java. [URL="https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B2Py9P6bOfVlYjgwYjYyZTktM2JhYi00YmY0LTgzMzAtZjg5M2Y5MzdhZWFm&hl=en_US&pli=1"]Clickity click link 'ere![/URL] I take no credits for this.
  14. Ok, I'm confused I'm trying to use a JComboBox and get what the user has selected and use a button that gets the users selected item from the ComboBox menu and gets a username and does the action. How would I be able to do that? [code] /** * * @author Divine-X * */ public class Main extends javax.swing.JFrame { private static final long serialVersionUID = -4068928767942816894L; private static int HEIGHT = 300, WIDTH = 455; private java.awt.Font Rockwell; public Main() { initComponents(); setPreferredSize(new java.awt.Dimension(WIDTH, HEIGHT)); pack(); setLocationRelativeTo(null); setResizable(false); } /** This method is called from within the constructor to * initialize the form */ private void initComponents() { java.awt.Font Rockwell = new java.awt.Font ("Rockwell", java.awt.Font.BOLD, 12); String[] Commands = {"Ban", "Mute", "Kick", "Jail", "Unban", "Unmute", "Unjail"}; jTabbedPane = new javax.swing.JTabbedPane(1); contentPane = new javax.swing.JLayeredPane(); playerNameJTextField = new javax.swing.JTextField(); punishMentComboBox = new javax.swing.JComboBox(Commands); playerNameJLabel = new javax.swing.JLabel(); setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("Divine-X Framework"); this.contentPane = new javax.swing.JLayeredPane(); this.contentPane.setBorder(new javax.swing.border.EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); jPanel1 = new javax.swing.JPanel(); jPanel1.setBounds(0, 0, 450, 455); this.contentPane.add(jPanel1); jPanel1.setLayout(new java.awt.BorderLayout(0, 0)); jPanel1.add(jTabbedPane); jPanel1 = new javax.swing.JPanel(); jTabbedPane.addTab("Main", null, jPanel1, null); jPanel1.add(punishMentComboBox); jPanel1.add(playerNameJTextField); jPanel1.add(playerNameJLabel); jPanel1.setLayout(null); /** * JComboBox */ punishMentComboBox.setBounds(160, 75, 100, 25); punishMentComboBox.setFont(Rockwell); /** * JLabel */ playerNameJLabel.setBounds(130, 2, 300, 25); playerNameJLabel.setText("Enter a player name below:"); playerNameJLabel.setFont(Rockwell); /** * JTextField */ playerNameJTextField.setBounds(75, 40, 300, 25); playerNameJTextField.setFont(Rockwell); } /** * @param args command line arguments */ public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } //Variable declaration do no modify private javax.swing.JTabbedPane jTabbedPane; private javax.swing.JLayeredPane contentPane; private javax.swing.JPanel jPanel1; private javax.swing.JTextField playerNameJTextField; private javax.swing.JComboBox punishMentComboBox; private javax.swing.JLabel playerNameJLabel; //End of variable declarations } [/code] If you run the GUI you might say I took Jon's design but I liked the design and I decided to use it. Big GUIs are like.. Ugh. And small simple ones are amazing.
  15. Hello, I'm going to be remaking my [URL="http://www.runelocus.com/forums/showthread.php?25068-562-Rs2hd-Divine-X-GUI"]RS2HD Divine-X GUI[/URL] from scratch :). It's nothing big but I wanted to make a project thread because just like [URL="http://www.runelocus.com/forums/member.php?1598-Jon"]Jon[/URL] said it's going to kill me to write it all from scratch. Media: [img]http://i39.tinypic.com/e8om1e.jpg[/img] Legend: [COLOR="#008000"]Green = Done[/COLOR] [COLOR="#00FF00"]Light Green = Almost done[/COLOR] [COLOR="#FF8C00"]Orange = Half[/COLOR] [COLOR="#FFA500"]Light Orange = Close to half[/COLOR] [COLOR="#B22222"]Dark red = Started but not at half[/COLOR] [COLOR="#FF0000"]Red = Not started[/COLOR] To-do List: [COLOR="#B22222"]Everything from the Divine-X GUI, Not everything somethings removed[/COLOR] [COLOR="#FF0000"]Command Console[/COLOR] Ideas will be allowed. Source Code: [code]/** * * @author Divine-X * */ @SuppressWarnings("serial") public class Main extends javax.swing.JFrame { /** * Class Constructor */ public Main() { initComponents(); setSize(450, 500); setResizable(false); } private void initComponents() { jTabbedPane = new javax.swing.JTabbedPane(1); contentPane = new javax.swing.JLayeredPane(); BanUserButton = new javax.swing.JButton(); enterPlayerNameLabel = new javax.swing.JLabel(); enterPlayerNameJTextField = new javax.swing.JTextField(); setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("Divine-X Framework"); this.contentPane = new javax.swing.JLayeredPane(); this.contentPane.setBorder(new javax.swing.border.EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); jPanel1 = new javax.swing.JPanel(); jPanel1.setBounds(0, 0, 440, 490); this.contentPane.add(jPanel1); jPanel1.setLayout(new java.awt.BorderLayout(0, 0)); jPanel1.add(jTabbedPane); jPanel1 = new javax.swing.JPanel(); jTabbedPane.addTab("Main", null, jPanel1, null); jPanel1.add(BanUserButton); jPanel1.add(enterPlayerNameLabel); jPanel1.add(enterPlayerNameJTextField); jPanel1.setLayout(null); /** * Labels <-- Is this comment needed ??? Are labels needed ??? */ enterPlayerNameLabel.setBounds(0, 0, 0, 0); enterPlayerNameLabel.setText("Player Name Here: "); enterPlayerNameLabel.setFont(new java.awt.Font("Rockwell", 1, 12)); /** * Text field */ enterPlayerNameJTextField.setText("Enter player name here"); enterPlayerNameJTextField.setFont(new java.awt.Font("Rockwell", 1, 12)); enterPlayerNameJTextField.setBounds(65, 10, 300, 25); /** * Button Handling */ BanUserButton.setText("Ban User"); BanUserButton.setBounds(145, 40, 130, 25); BanUserButton.setFont(new java.awt.Font("Rockwell", 1, 12)); BanUserButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sendMessageButtonActionPerformed(evt); } }); } /** * Button Effects * @param evt */ protected void sendMessageButtonActionPerformed(java.awt.event.ActionEvent evt) { String player = enterPlayerNameJTextField.getText(); //for(Player p : World.getInstance().getPlayerList()) //{ //if(p.getUsername().equalsIgnoreCase(player)) //{ //p.banned = 1; //p.getActionSender().sendLogout(); //} javax.swing.JOptionPane.showMessageDialog(null, "You've banned: " + player + "; stopping their connection now."); //} } /** * @param args the command line arguments */ public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } //Declared variables do not modify private javax.swing.JTabbedPane jTabbedPane; private javax.swing.JLayeredPane contentPane; private javax.swing.JButton BanUserButton; private javax.swing.JLabel enterPlayerNameLabel; private javax.swing.JPanel jPanel1; private javax.swing.JTextField enterPlayerNameJTextField; //End of variable declarations } [/code]
  16. I'm trying to create my own server and I've done everything the tutorial has told me to do. I've gotten to the very end to where it says: "To test and see if it is running, go into the source files and open "Run-Server". Then, go into the client files and go into GUI and change the Ip to 127.0.0.1 and try playing on it. You probably will unless you did something wrong." This part is confusing. I can't find the GUI in the client to change the IP. Any help here? Thanks
  17. Hey guys. So I downloaded this source and tried to get a friend on it so he could check it out. I can run the client, but he cannot. He gets the error 'cannot find main class: gui program will exit' or something like that. Can anyone please help?
  18. Chaser1080

    No Gui

    I just downloaded a client to make it mine and theres no gui.java to put my ip.. Where can i put it then?
  19. [COLOR="#0000FF"][CENTER]Finished my v2.0 Dumper GUI. I was busy all last month so i couldnt finish it, Today i was home so i finished alot. Features: -Dumpers from v1 -Price -equipId -itemDef -itemList, npcList, objectList Media: [IMG]http://i41.tinypic.com/atusqq.png[/IMG] [IMG]http://i40.tinypic.com/wqvihh.png[/IMG] Link: Mediafire - [url=http://www.mediafire.com/?a9h5jz9n7q8jqjj]Click here[/url] Uppit - [URL=http://up.ht/uLUEuA]Click here[/URL][/CENTER][/COLOR]
  20. I'm going to be showing you how to create a GUI in Java :3. I've posted.. 2 Java GUI tutorials on Runelocus both requiring the use of an IDE, netbeans to be accurate.. But this time we will be using: Notepad, Notepad++, Dreamweaver, w/e is in your possession besides netbeans! To start off create a new class. I've named my class "Main." And add [code]public static void main(String[] args) {[/code] this is what Java searches for when your trying to run something in Java. It's basically the Brain of the class. Without the Brain the body cannot function. [code] package gui; /** * @Author Divine-X */ public class Main extends JFrame { /** * @param args */ public static void main(String[] args) { }[/code] Next to the name of your class add this [code] extends JFrame [/code] and import [code]import javax.swing.JFrame;[/code] [code] package gui; import javax.swing.JFrame; /** * @Author Divine-X */ public class Main extends JFrame { /** * @param args */ public static void main(String[] args) { }[/code] Now under our [code]public static void main(String[] args) {[/code] add [code] try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); }[/code] And import [code]import javax.swing.UIManager; import java.awt.EventQueue;[/code] [code]package gui; import javax.swing.JFrame; import javax.swing.UIManager; import java.awt.EventQueue; /** * @Author Divine-X */ public class Main extends JFrame { /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } }[/code] Now what were going to do just incase ontop of our class header were going to add[code]@SuppressWarnings("serial")[/code] [code]package gui; import javax.swing.JFrame; import javax.swing.UIManager; import java.awt.EventQueue; /** * @Author Divine-X */ @SuppressWarnings("serial")//It's not needed but just for precautions public class Main extends JFrame { /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } }[/code] Now were going to create the constructor of the class. Constructors are like public methods but use the Classes name and can't be returned. I could be wrong I'm not good on explaining things >.<! And were going to want to create 2 ints also. [code]private static final int W = 350; private static final int L = 420;[/code] Private means it can only be accessed, used, in this class only. So if your new to RSPS and your wondering what's the difference between private and public, public means used anywhere private means used in the class it's created in. [code]package gui; /**Java Imports*/ import java.awt.EventQueue; /**GUI/Javax Imports*/ import javax.swing.JFrame; import javax.swing.UIManager; /** * @Author Divine-X */ @SuppressWarnings("serial") public class Main extends JFrame { private static final int W = 350; private static final int L = 420; /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } /**Class Constructor*/ public Main() { } }[/code] Now in our constructor were going to want to add these in it [code] setResizable(false);//Makes it so they can't edit the size of the GUI setTitle("Your GUI Name Here!");//The title of the GUI setDefaultCloseOperation(EXIT_ON_CLOSE);//So when we exit the GUI it will Close it 100% setSize(W, L);//Sets the Width and Length by getting the numbers from the integers we previously created[/code] Now where our other ints are ontop of them add [code]private JLayeredPane contentPane;[/code] And in our constructor we would want to add this [code] this.contentPane = new JLayeredPane();//Creates a new JLayer and sends it to GUI this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));//Emptyborders, I can't explain it good >.< it just shows no borders setContentPane(this.contentPane); JPanel jPanel = new JPanel();//Creates a new JPanel jPanel.setBounds(0, 0, 340, 410);//The first 2 numbers are default 0 and 3rd and 4th need to be atleast Default Width - 10 = new Width same for length this.contentPane.add(jPanel);//Add the jPanel jPanel.setLayout(new BorderLayout(0, 0));//Can't explain JTabbedPane parentTab = new JTabbedPane(1);//Creates 1 JTabbedPane only need 1 for GUIs jPanel.add(parentTab);//Add the recently created jPanel to the JTab JPanel jPanel1 = new JPanel();//New instance of a JPanel parentTab.addTab("Tab1", null, jPanel1, null);//Sends the JPanel to the JTab to be viewed on gui jPanel1.setLayout(null);//Sets the layout to null(default) JPanel jPanel2 = new JPanel();//New Instance of a JPanel parentTab.addTab("Tab2", null, jPanel2, null);//Sends the JPanel to the JTab to be viewed on gui jPanel2.setLayout(null);//Sets the layout to null(default)[/code] And import [code]import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import java.awt.BorderLayout;[/code] [code]package gui; /**Java Imports*/ import java.io.IOException; import java.awt.BorderLayout; import java.awt.EventQueue; /**GUI/Javax Imports*/ import javax.swing.JFrame; import javax.swing.JLayeredPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; /** * @Author Divine-X */ @SuppressWarnings("serial") public class Main extends JFrame { private JLayeredPane contentPane; private static final int W = 350; private static final int L = 420; /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } /**Creates a new form*/ public Main() { setResizable(false); setTitle("Your GUI Name Here!"); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(W, L); this.contentPane = new JLayeredPane(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); JPanel jPanel = new JPanel(); jPanel.setBounds(0, 0, 340, 410); this.contentPane.add(jPanel); jPanel.setLayout(new BorderLayout(0, 0)); JTabbedPane parentTab = new JTabbedPane(1); jPanel.add(parentTab); JPanel jPanel1 = new JPanel(); parentTab.addTab("Tab1", null, jPanel1, null); jPanel1.setLayout(null); JPanel jPanel2 = new JPanel(); parentTab.addTab("Tab2", null, jPanel2, null); jPanel2.setLayout(null); } } [/code] Now under [code]parentTab.addTab("Tab1", null, jPanel1, null);[/code] Add [code] textArea.setFont(new Font("Rockwell", 1, 12)); textArea.setBounds(0, 208, 343, 150);//1st number = X-Axis, 2nd number = Y-Axis, 3rd Number = Width, 4th = Height; The thing with Java is that Java's coordinate plotting is different then ours. Their (0,0) would be at the top left of your screen, not the center. So you would have to experiment for the right numbers for awhile textArea.setEditable(false);//So they can't edit the text jPanel1.add(textArea);//Adds it to the 1st tab[/code] And where our ints are add[code]private static JTextArea textArea = new JTextArea();[/code] [code]package gui; /**Java Imports*/ import java.io.IOException; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; /**GUI/Javax Imports*/ import javax.swing.JFrame; import javax.swing.JLayeredPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; /** * @Author Divine-X */ @SuppressWarnings("serial") public class Main extends JFrame { private static JTextArea textArea = new JTextArea(); private JLayeredPane contentPane; private static final int W = 350; private static final int L = 420; /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } /**Creates a new form*/ public Main() { setResizable(false); setTitle("Your GUI Name Here!"); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(W, L); this.contentPane = new JLayeredPane(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); JPanel jPanel = new JPanel(); jPanel.setBounds(0, 0, 340, 410); this.contentPane.add(jPanel); jPanel.setLayout(new BorderLayout(0, 0)); JTabbedPane parentTab = new JTabbedPane(1); jPanel.add(parentTab); JPanel jPanel1 = new JPanel(); parentTab.addTab("Tab1", null, jPanel1, null); textArea.setFont(new Font("Rockwell", 0, 12)); textArea.setBounds(0, 208, 343, 150); textArea.setEditable(false); jPanel1.add(textArea); jPanel1.setLayout(null); JPanel jPanel2 = new JPanel(); parentTab.addTab("Tab2", null, jPanel2, null); jPanel2.setLayout(null); } } [/code] Under [code]jPanel1.add(textArea);[/code] Add[code] sndMsg.addActionListener(new ActionListener() {//Listens to the mouse if the button is clicked public void actionPerformed(ActionEvent e) {//Starts it off Main.textArea.append("Hehe Haidar!\n");//Sends the message to the textArea we added to the GUI; Main = Class, textArea = where we would like the message to go, append = Add the string, text, to the destination } }); sndMsg.setFont(new Font("Rockwell", 1, 12)); sndMsg.setBounds(26, 16, 290, 28);//Place the button on the GUI jPanel1.add(sndMsg);//Add the button to the GUI[/code] And import [code]import javax.swing.JButton; import javax.swing.JOptionPane;[/code] And where our ints are add [code] private JButton sndMsg = new JButton("Click here to send a default message!"); [/code] [code]package gui; /**Java Imports*/ import java.io.IOException; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /**GUI/Javax Imports*/ import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLayeredPane; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; /** * @Author Divine-X */ @SuppressWarnings("serial") public class Main extends JFrame { private static JTextArea textArea = new JTextArea(); private JButton sndMsg = new JButton("Click here to send a default message!"); private JLayeredPane contentPane; private static final int W = 350; private static final int L = 420; /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } /**Creates a new form*/ public Main() { setResizable(false); setTitle("Your GUI Name Here!"); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(W, L); this.contentPane = new JLayeredPane(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); JPanel jPanel = new JPanel(); jPanel.setBounds(0, 0, 340, 410); this.contentPane.add(jPanel); jPanel.setLayout(new BorderLayout(0, 0)); JTabbedPane parentTab = new JTabbedPane(1); jPanel.add(parentTab); JPanel jPanel1 = new JPanel(); parentTab.addTab("Tab1", null, jPanel1, null); //Text Area textArea.setFont(new Font("Rockwell", 0, 12)); textArea.setBounds(0, 208, 343, 150); textArea.setEditable(false); jPanel1.add(textArea); //Buttons sndMsg.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Main.textArea.append("Hehe Haidar!\n"); } }); sndMsg.setFont(new Font("Rockwell", 1, 12)); sndMsg.setBounds(26, 16, 290, 28); jPanel1.add(sndMsg); jPanel1.setLayout(null); JPanel jPanel2 = new JPanel(); parentTab.addTab("Tab2", null, jPanel2, null); jPanel2.setLayout(null); } } [/code] Now under [code]jPanel1.add(sndMsg);[/code] Add this[code] opnDia.addActionListener(new ActionListener() {//Listens for the mouse if it clicked this button public void actionPerformed(ActionEvent e) {//Send the action String i = JOptionPane.showInputDialog(null, "How are you?", "Question", JOptionPane.QUESTION_MESSAGE);//Making this a string allows us to get the users input; null = center of screen, String 2 = Message/Body, String 3 = Title Main.textArea.append("Your feeling " +i+ "?\nSo am I!\n");//Send the input the user has entered to the TextBox; \n = new line, \t = tab } }); opnDia.setFont(new Font("Rockwell", 1, 12)); opnDia.setBounds(26, 59, 290, 28);//Again play with this to find the right area jPanel1.add(opnDia);//Adds the Button to the GUI[/code] [code]package gui; /**Java Imports*/ import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /**GUI/Javax Imports*/ import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLayeredPane; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; /** * @Author Divine-X */ @SuppressWarnings("serial") public class Main extends JFrame { private static JTextArea textArea = new JTextArea(); private JButton sndMsg = new JButton("Click here to send a default message!"); private JButton opnDia = new JButton("Click here to send a question!"); private JLayeredPane contentPane; private static final int W = 350; private static final int L = 420; /** * @param args */ public static void main(String[] args) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch(Throwable e) { e.printStackTrace(); } EventQueue.invokeLater(new Runnable() { public void run() { new Main().setVisible(true); } }); } /**Creates a new form*/ public Main() { setResizable(false); setTitle("Your GUI Name Here!"); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(W, L); this.contentPane = new JLayeredPane(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(this.contentPane); JPanel jPanel = new JPanel(); jPanel.setBounds(0, 0, 340, 410); this.contentPane.add(jPanel); jPanel.setLayout(new BorderLayout(0, 0)); JTabbedPane parentTab = new JTabbedPane(1); jPanel.add(parentTab); JPanel jPanel1 = new JPanel(); parentTab.addTab("Tab1", null, jPanel1, null); //Text Area textArea.setFont(new Font("Rockwell", 1, 12)); textArea.setBounds(0, 208, 343, 150); textArea.setEditable(false); jPanel1.add(textArea); //Buttons sndMsg.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Main.textArea.append("Hehe Haidar!\n"); } }); sndMsg.setFont(new Font("Rockwell", 1, 12)); sndMsg.setBounds(26, 16, 290, 28); jPanel1.add(sndMsg); opnDia.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String i = JOptionPane.showInputDialog(null, "How are you?", "Question", JOptionPane.QUESTION_MESSAGE); Main.textArea.append("Your feeling " +i+ "?\nSo am I!\n"); } }); opnDia.setFont(new Font("Rockwell", 1, 12)); opnDia.setBounds(26, 59, 290, 28); jPanel1.add(opnDia); jPanel1.setLayout(null); JPanel jPanel2 = new JPanel(); parentTab.addTab("Tab2", null, jPanel2, null); jPanel2.setLayout(null); } } [/code] And if you followed this tutorial correctly your GUI should've went through these phases of design. [IMG]http://i1092.photobucket.com/albums/i403/Divine-X/GUI1.png[/IMG] [IMG]http://i1092.photobucket.com/albums/i403/Divine-X/GUI2.png[/IMG] [IMG]http://i1092.photobucket.com/albums/i403/Divine-X/GUI3.png[/IMG] [IMG]http://i1092.photobucket.com/albums/i403/Divine-X/GUI4.png[/IMG] [IMG]http://i1092.photobucket.com/albums/i403/Divine-X/GUI5.png[/IMG] Now to run & compile the gui make 2 new .txt files name one run.bat and the other compile.bat Now in run.bat add this[code]@echo off "C:\Program Files\Java\jre6\bin\java.exe" -classpath bin; gui.Main pause [/code] You might have to change the directory alittle bit for finding the class file. Compile.bat [code]@echo off echo Compiling cd . mkdir bin "C:\Program Files\Java\jdk1.6.0_27\bin\javac.exe" -d bin -sourcepath src src/gui/*.java pause [/code] And that's it! Hoped this helped you in creating Java GUIs!
  21. [CENTER][COLOR="#2F4F4F"]Hello, Hey some of you guys are still having problems with dumping information from runewiki. So I made this GUI based on request from Tyler aka Skrillex. This is my first attempt so it's the first version. Soon more will come out with different features. Important things needed to be known: -When using the GUI, please use the batch runner or If you started dumping, It wont close till all finished unless you end the task via Task manager! -You must place the cache in the data/cache folder or it wont dump! -All the dumps will be in the dumps folder not in data. -The examine dump is not perfect, It will sometimes dump html codes so you can delete those dumped items. Link - [url=http://www.mediafire.com/?e5cb7mfpgsbxipa]Click here[/url] Media: [IMG]http://i53.tinypic.com/2mgqngn.png[/IMG] [IMG]http://i55.tinypic.com/qowp61.png[/IMG] [IMG]http://i51.tinypic.com/2lax5kj.png[/IMG] [IMG]http://i53.tinypic.com/24luhbr.png[/IMG] Credits: Me - GUI Tyler (aka Skrillex) - Providing the needed materials. Hope you guys enjoy this GUI.[/COLOR][/CENTER]
  22. Exception in thread "main" java.lang.UnsupportedClassVersionError: Gui : Unsuppo rted major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Gui. Program will exit. Press any key to continue . . . Well i get this error when i load my client to play, however, the client works on my friends pc's and works on my vps.. just not my pc.. its making me annoyed now because im the only one who can't bloody play it, never experienced this error before, if anyone fixed this ill end up paying you! I belive my Paths and classpaths are set, my compilers work, and all my java's are updated to latest versions.. someone please help:@
  23. My players of my server have reported this error while they try and load the servers download client. I can get on it on my computer, don't know whats happening. Please help! :(
×