Posts

How to implement stack data structure in Java without using collections.

Implementing Stack without using Collections  // Create interface called Stack public interface Stack { void push(Object value ); Object pop(); int length(); } // Create class implementing Stack interface named StackImpl public class StackImpl implements Stack { private Node head ; private int length ; @Override public void push(Object value ) { Node node = new Node( value ); if ( head == null ) { head = node ; } else { node . next = head ; head = node ; } length ++; } @Override public Object pop() { Object result = null ; if ( head != null ) { result = head . value ; head = head . next ; length --; } return result ; } public int length() { return length ; } private class Node { private Object value ; private Node next ; public Node(Object value ) { super (); this . value...

Gluon Announces Full Java 9 Mobile Initiative

Gluon  has announced the  Gluon VM  project bringing Java 9 support to mobile developers and unlocking the availability of all OpenJDK APIs.  As a full OpenJDK implementation, the company says their Gluon VM will form the basis for future releases of  Gluon mobile , and will allow enterprise developers to benefit from the latest developments in Java 8 and Java 9. Launched 18 months ago, the Gluon mobile offering provides plugins for the main Java IDEs, for building Java applications for Android and iOS platforms using a single code base. According to company co-founder John Vos, Gluon Mobile abstracts out the underlying hardware, providing a common API for accessing hardware and building dynamic user interfaces. In order to execute Java code on mobile devices the device must be able to interpret Java bytecode, and therein lies the rub. Until now Gluon Mobile deployments on Android devices would ...

Differences between JavaFX and Swing

NOTE : Oracle hasn't completely abandoned Swing — it isn't deprecated, and Swing applications continue to work. But no work is being done anymore to enhance Swing, and Oracle has made it clear that JavaFX is the future. Here are ten basic differences between JavaFX and Swing. In JavaFX, all the world's a stage In Swing, the class that holds your user interface components is called a frame and is defined by the JFrame class. A frame is essentially an empty window to which you can add a panel, which serves as a container for your user-interface elements. A panel is defined by the JPanel class. A Swing application is actually a class that extends the JFrame class. To display user-interface components, you add components to a JPanel and then add the panel to the frame. JavaFX uses the metaphor of a theater to model the top-level containers of an application. A stage (defined by the Stage class) represents the highest level container — ty...

The improved Java packager would include features to align with a modular Java platform

Java modules, in the works for years and now set to debut in 2016, will involve improvements to the Java Packager, to reduce the size of the Java Runtime Environment. In a JDK Enhancement Proposal (JEP) floated this week on an Internet bulletin board, the Java Packager tool could be integrated with features from the  Project Jigsaw  modularization plan. Java Packager is used to compile, package, and deploy Java applications from the command line. “The Java Packager has always generated huge binaries when it is asked to bundle a runtime as part of its packaging due to the size of the JRE, which for some distributions is on the order of 100MB,” the proposal states. “Jigsaw will expose tools and techniques that can reduce the size of the JRE we need to package.” The proposal stipulates that, for the most part, packager workflow will remain as is. But tools from Jigsaw will be added and replace some steps. The packager will only create applications using the JDK 9 ...

JavaFX adds docking library for easier use, better customization

DockFX fills a void, enabling developers to build fluid, customizable interfaces similar to Visual Studio, Eclipse, or GIMP JavaFX has been Java's under-the-radar platform for building rich client applications. While it hasn't garnered the attention that rival platforms like Adobe Flash or JavaScript have received, it continues to plod along in the Java development community, with a loyal set of users. One such user is building a docking library for the platform to make it easier to use. Found on GitHub, the DockFx library was built to fill what the developer cites as a void for docking frameworks available for JavaFX. "DockFX is a library that enables application developers to create customizable and fluid interfaces for their end users, move side panels, hide panels out of view, or drag panels out and get a closer look,". "The library makes it possible to create an interface similar to Visual Studio, Eclipse, or GIMP in very little time without ...

A Beginner’s Guide to Google AdSense

 Sure, affiliate marketing is an excellent way to monetize a web site or blog. It has the amazing benefit of not requiring stock, and in many cases it’s a set and forget strategy. Often though, many affiliates, including myself, will also run Google AdSense on their web sites. Adsense is a nice alternative, or complimentary monetization strategy to affiliate marketing. My income increases when using AdSense – my affiliate sales are unaffected It used to be that I was afraid to “lose customers” when implementing Google AdSense on my affiliate sites, because when they click the AdSense ads they leave the web site. But test after test showed me that implementing AdSense often did not have any negative effect on affiliate commissions. So, really all it did was boost my income and allowed me to distribute risk by having more than just one monetization strategy. AdSense ads run in designated areas on your web site – advertisers pay Google to run ads there – but you get ...

Do you know about XUL?

What is XUL and why was it created? XUL (pronounced "zool" and rhyming with "cool") was created to make development of the Mozilla browser easier and faster. It is an XML language so all features available to XML are also available to XUL. Most applications need to be developed using features of a specific platform making building cross-platform software time-consuming and costly. A number of cross-platform solutions have been developed in the past. Java, for example, has portability as a main selling point. XUL is one such language designed specifically for building portable user interfaces. It takes a long time to build an application even for only one platform. The time required to compile and debug can be lengthy. With XUL, an interface can be implemented and modified quickly and easily. XUL has all the advantages of other XML languages. For example XHTML or other XML languages such as MathML or SVG can be inserted within it. Also, text displayed with ...