Search the Community

Showing results for tags 'java'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Brandon and Book News
  • Events, Signings, & Giveaways
  • Columns and Features
  • Site News
  • Shardcast

Forums

  • 17th Shard
    • Introduce Yourself!
    • 17th Shard Discussion
    • The Coppermind Wiki
    • Arcanum Discussion
  • Brandon Sanderson
    • General Brandon Discussion
    • Events and Signings
    • Sanderson Fan Works
    • Arcanum, the Brandon Sanderson Archive
  • Spoiler Zone
    • The Lost Metal (Mistborn Spoilers Only, No Cosmere)
    • Tress of the Emerald Sea (No Cosmere Spoilers)
    • New Cosmere Releases (Lost Metal and Tress Spoilers)
  • The Cosmere
    • Cosmere Q&A
    • Cosmere Discussion
    • Cosmere Secret Projects Previews
    • Stormlight Archive
    • Mistborn
    • Elantris and Emperor's Soul
    • Warbreaker
    • White Sand
    • Cosmere Short Stories
    • Unpublished Works
  • Non-cosmere Works
    • Non-cosmere Secret Project
    • The Reckoners
    • Skyward
    • The Rithmatist
    • Alcatraz
    • Dark One
    • Other Stories
    • The Wheel of Time
  • Related Works
    • Writing Excuses
    • Reading Excuses
    • TWG Archive
  • Community
    • General Discussion
    • Entertainment Discussion
    • Science, Tech, and Math Discussion
    • Creator's Corner
    • Role-Playing
    • Social Groups, Clans, and Guilds

Blogs

  • Chaos' Blog
  • Leinton's Blog
  • 17th Shard Blog
  • KChan's Blog
  • Puck's Blag
  • Brandon's Blog
  • Darth Squirrely's Blog
  • Tales of a Firebug
  • borborygmus' Blog
  • Zeadman's Blog
  • zas678's Blog
  • The Basement
  • Addy's Avocations
  • Zarepath's Blog
  • First time reading The Well Of Ascension
  • Seshperankh's Blog
  • "I Have Opinions About Books"
  • Test
  • Which actors would you like to see playing the characters of Mistborn?
  • Drifted Mists
  • Jaron's Realm
  • Roshar Speculative Theories
  • ChrisHamatake's Blog
  • Paradox Flint's Blog
  • Deoradhan's Blog
  • Storm Blessed's Blog
  • Elwynn's Blog
  • firstRainbowRose's Blog
  • Rotabush ShardBlog
  • Hoid's Compendium
  • InterContinental Adventures
  • Claincy Creates
  • WoR Thoughts and Questions
  • Blogfalcon
  • David Coppercloud's Blog
  • yurisses' notes and theories
  • Lark Adventures
  • LUNA's Poetry
  • Inspiration Board
  • Trying to be Useful for a Change
  • The Way of Toasters
  • Cosmere Nerd Things
  • Dapper's Music Blog
  • Shhh Spoilers for Ronald.
  • Wyn's Adventures in Geekiness
  • Words With Ene
  • Dapper's Blog
  • Things to talk about, stuff to do
  • Zelly's Healthy-Accountability Blog
  • Even These Acronyms
  • Rhythm of War Liveblog
  • Unnecessarily Overcomplicated
  • Star's Art Blog
  • Weather Reports
  • Axioms Idioms & Adages
  • The Blog of Dubious Copyright Legality
  • Trutharchivist's Rambles
  • 5
  • Xino's corner of insanity
  • The Perfect Space Opera
  • My Journey Through Roshar (A Liveblog)
  • Lost Metal Liveblog by ccstat
  • The cheeseman does worldbuilding.

Calendars

  • Community Calendar

Found 2 results

  1. In Java, if I try to do.equals() on a null string, a null pointer error is issued. I'm wondering whether I can perform the following if I'm attempting to compare if a string is equal to a constant string: MY CONSTANT STRING.equals(aStringVariable) I'm sure it'll work, but is this simply extremely bad code? This is a common Java idiom known colloquially as a Yoda condition. Personally, I prefer to handle the null situation directly, but the Yoda method is widely used, and any competent Java programmer should quickly grasp what is going on. How should I proceed?
  2. I'm building a scripting language on top of the Java Virtual Machine. I can dynamically build Java auxiliary objects, access their properties, and activate their methods via reflection. However, I have now hard-coded particular event processing. For example, JScrollBar addAdjustmentListener() makes use of the Adjustable interface, JFrame windowClosing() makes use of the WindowAdapter interface, and JButton addActionListener makes use of the ActionListener interface. An anonymous function is called with the event data on the event receiving end of the scripting language, with 0-1 or 2 arguments of any kinds. My issue is, is there a (reflective) method to handle arbitrary events in Java? Handling all JComponent subclass events in general would also be a good place to start.