Thread: Working on a new launcher(Learning experience)

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 Working on a new launcher(Learning experience) 
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Recently I've begun working on a custom launcher that I'm trying to make as user/owner friendly as possible. I won't claim it's good. I mostly consider it practice as I'm not very familiar with the Java Gui (JFrames, JPanels, everything). I've also recently started trying to improve my knowledge of regex, so there's quite a bit of that in there(even though I may be overusing it). I've only been working on it a couple days, but here it is:

    Honestly if you don't want to read ignore this, I added almost everything I did
    Spoiler for INFO:

    -Create Base (Jpanel, JFrame, actionHandler etc.)
    -Add basic buttons and functions (close and minimize button)
    -added dragging for window
    (had to do this since I setLayout as null and or undecorated as true)
    -Created XML file/filled with dummy info as test
    -set up so xml file will be downloaded via a link or a local copy used (this is temporary, plan to switch to an RSS Feed later)
    -Addition methods used
    ------Format date with regex(View XML date/screenshot of launcher to see)
    ------added custom ellipsis method if text is too long (ellipsis = "..." symbol)
    -----------did this because JLabel did not do it automatically after html was added. This was an unnecessary pain
    because I decided to use StringWidth instead of estimating by a number of characters because I'm picky
    ------added getLine method to return a string of second line of a JLabel as seen (had to do this so ellipsis was only on second line)

    -Add Notifications for recent Updates
    ------added int to limit shown notifications
    ------Enlarge/Shrink Notifications for displaying info
    ------add URL button that only shows if link exists in xml file (or if it's not blank)
    -----------if "https://" is forgotten it will be added to the link before opening
    ------added close button for each notification
    ------added title/description/date (grabbed from xml file)
    -----------made a "\n" in the description in xml skip a line in the JLabel (originally just displayed it on the button)
    -----------made adjustments to getLine method so that it'd factor in \n skipping lines
    ------added a method to re position notification buttons (whether enlarged or closed)
    ------added support for html in previously created methods (had to adjust ellipsis method so the tags wouldn't interfere with StringWidth (more regex))
    ------date moved/underlined when expanded and moved back/underline removed when shrunk (more regex, but could have used other ways)


    TODO:
    -Add Play button that downloads client/updates (Needs downloading methods and everything else)
    -Add a progress bar to show how far current download is.
    -Add Title for Launcher itself (forgot this in the beginning, but it's easy to add)
    -Server online text
    -Add functionality to the menu button in top left
    ------Add links to the menu that I plan to make pop out of the left side of the launcher
    ----------notifications be moved when opened, moved permanently, or menu opened over them?
    ------make menu close when clicked anywhere else (already have mouseListener set up)
    ------Add some nice icons to each button, like a shopping bag for donate, or a house for website home etc.
    -Add download cache button? thoughts? would this be a good addition or naw?
    -Add HoverButton icons (This is easy, but I don't have the icons and I'm not artistic so this can wait)
    -Add Tray icon for following links
    -add System Notifications when new client or server update is available?
    ------If I do this, make it so you can disable these for client/server or both
    ------If launcher is open, have lowest button removed, and newest one added on top
    ------add option for close button to instead add to tray
    ------add settings button in menu with a popup to customize all these options ^
    -have launcher save preferences

    LAST: Rewrite/clean parts I know can be done better (already quite a few things)


    This is just the xml file i used filled with garbage to test everything out
    Spoiler for XmlCodeExample:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <updates>
    <update>
    <date>january 5 2018</date>
    <title>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX  YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV  WXYZ</title>
    <description>1<htmlData><![CDATA[<u>hello how are</u>you<br>doing this fine <font color='red'>day? <u>I eat</font> waffles when I wake up no matter where it is</u>]]></htmlData></description>
    </update>
    <update>
    <date>5-17-18</date>
    <title>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX  YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV  WXYZ</title>
    <description>2hello how are you\ndoing this fine day? I eat waffles when I wake up no matter where it is</description>
    <link>http://www.google.com</link>
    </update>
    <update>
    <date>5/21/18</date>
    <title>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX  YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV  WXYZ</title>
    <description>The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog.</description>
    <link>www.google.com</link>
    </update>
    <update>
    <date>march 10 19</date>
    <title>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX  YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV  WXYZ</title>
    <description>The Quick Brown Fox Jumps\n Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog. The Quick Brown Fox Jumps Over The Lazy Dog.</description>
    <link>google.com</link>
    </update>
    </updates>

    I like to believe it'd look a little nicer with some actual icons and whatnot made for it by someone who knows what they're doing, instead of whatever I could get my hands on

    Spoiler for Media:
    Attached imageAttached imageAttached image


    If anyone is interested in the progress I make I can continue to post updates, but let's be honest, it's nothing special, but as someone who has self-taught 90% of what I know, I'm proud of it so far.
    I know not a lot looks like it's done, but it took quite a bit of effort to get the notifications the way I envisioned it, since I refused to settle on anything else
    Reply With Quote  
     

  2. #2  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Apollo View Post
    I mostly consider it practice as I'm not very familiar with the Java Gui (JFrames, JPanels, everything).
    Yikes are you using swing? What ancient tutorials are you following lol

    That background is hideous.

    Best of luck, I remember how hideous my first guis were.
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Quote Originally Posted by nshusa View Post
    Yikes are you using swing? What ancient tutorials are you following lol

    That background is hideous.

    Best of luck, I remember how hideous my first guis were.
    Yea I'm using swing, I'm basically just using whatever I can find via google as reference to be honest. what do you suggest instead?
    also yea I also just grabbed whatever for the background, as I figured I'd find a better one that matches the rest of the launcher once I finished

    Discord: Apollo#2722
    Reply With Quote  
     

  5. #4  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Apollo View Post
    Yea I'm using swing, I'm basically just using whatever I can find via google as reference to be honest. what do you suggest instead?
    also yea I also just grabbed whatever for the background, as I figured I'd find a better one that matches the rest of the launcher once I finished
    I'd recommend JavaFX because you can style the GUI using CSS and you can also use controllers to follow MVC design pattern.

    Swing is old as shit, completely dead, layouts are trash, and styling is a nightmare.

    I also always use scenebuilder I know some people don't like it but I love it. I drag and drop shit and make the ui in a few seconds. It's the implementation of the tool that takes a while.

    If you like Kotlin there's https://github.com/edvin/tornadofx I don't use it cause I've used JavaFX forever. Also you can create custom components in scenebuilder no one knows about.
    Last edited by CrazyPanda; 05-17-2018 at 04:53 AM.
    Attached image
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Quote Originally Posted by nshusa View Post
    I'd recommend JavaFX because you can style the GUI using CSS and you can also use controllers to use MVC design pattern.

    This tool took me 2 days to create the whole thing. The layout took me 5 minutes, the stylesheet I use for all my programs its like a black spotify theme.
    That does look really nice, once I'm done with this, I'll probably rewrite it with JavaFx instead of swing then. I like css (though I'm not very good at it yet), and more learning couldn't hurt

    EDIT: Scenebuilder looks nice, but I'd most likely write everything by hand. Although it'll probably take longer, that's just the type of person I am

    Discord: Apollo#2722
    Reply With Quote  
     

  8. #6  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Apollo View Post
    I like css (though I'm not very good at it yet), and more learning couldn't hurt
    At least you'll learn how to style websites too haha

    Quote Originally Posted by Apollo View Post
    EDIT: Scenebuilder looks nice, but I'd most likely write everything by hand. Although it'll probably take longer, that's just the type of person I am
    I used to as well but after you write a 100 guis its gets very repetitive lol
    Attached image
    Reply With Quote  
     

  9. #7  
    "Do or do not. There is no try."
    Apollo's Avatar
    Join Date
    Mar 2016
    Posts
    70
    Thanks given
    4
    Thanks received
    19
    Rep Power
    13
    Quote Originally Posted by nshusa View Post
    At least you'll learn how to style websites too haha



    I used to as well but after you write a 100 guis its gets very repetitive lol
    I looked at a webpage that highlighted main differences between swing and JavaFX and to be honest I might just switch over to JavaFX now instead of continuing with swing. With adding properties for events, and easier animation (I want to add an animation to the menu button when it opens the menu) it seems worth it

    Discord: Apollo#2722
    Reply With Quote  
     

  10. #8  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Apollo View Post
    I looked at a webpage that highlighted main differences between swing and JavaFX and to be honest I might just switch over to JavaFX now instead of continuing with swing. With adding properties for events, and easier animation (I want to add an animation to the menu button when it opens the menu) it seems worth it
    yeah trust me you wont miss swing at all lol
    Attached image
    Reply With Quote  
     

  11. Thankful user:


  12. #9  
    Finland

    Zoltus's Avatar
    Join Date
    Dec 2015
    Age
    24
    Posts
    977
    Thanks given
    671
    Thanks received
    779
    Rep Power
    5000
    I recommend highly javafx too and to use scenebuilder with it. Gl learning!
    Last edited by Zoltus; 05-17-2018 at 10:04 AM.
    Attached image

    Spoiler for God:
    Attached image
    Reply With Quote  
     

  13. #10  
    (Official) Thanksgiver

    Arham's Avatar
    Join Date
    Jan 2013
    Age
    23
    Posts
    3,415
    Thanks given
    7,254
    Thanks received
    1,938
    Rep Power
    3905
    Quote Originally Posted by Zoltus View Post
    I recommend highly javafx too and to use scenebuilder with it. Gl learning!
    Fk scenebuilder man, always crashes on me.
    Attached image
    Attached image
    Quote Originally Posted by MrClassic View Post
    Arham is the official thanker!
    List of my work here!
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. How to get server working on mac. (NEW)
    By iDreez in forum Help
    Replies: 7
    Last Post: 04-21-2017, 11:29 PM
  2. Replies: 10
    Last Post: 05-19-2013, 06:09 PM
  3. Replies: 3
    Last Post: 01-06-2010, 12:50 PM
  4. Currently working on a new client
    By T X in forum RS2 Client
    Replies: 5
    Last Post: 01-04-2008, 04:47 AM
  5. What new skill shall i work on?
    By James in forum RS2 Server
    Replies: 10
    Last Post: 12-06-2007, 10:17 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •