Internet Foundation Classes
| Company type | Software library |
|---|---|
| Industry | Software development |
| Predecessor | Netcode Corporation |
| Founded | December 16, 1996 |
| Founder | Netcode Corporation |
| Fate | Merged into Java Foundation Classes and Swing |
Key people | Netscape Corporation, Sun Microsystems |
| Products | GUI widget toolkit, graphics library for Java |
The Internet Foundation Classes (IFC) represent a GUI widget toolkit and graphics library designed for Java. Originally created by Netcode Corporation, it was officially launched by Netscape Corporation on December 16, 1996.
IFC bore a strong resemblance to the initial versions of the Objective-C NeXTStep class libraries developed for NeXT systems. It featured a builder utility somewhat akin to NeXT's Interface Builder, albeit with fewer capabilities, which attracted NeXT developers who were beginning to work with Java.
History
On April 2, 1997, a collaboration between Sun Microsystems and Netscape was announced, aiming to combine IFC with additional technologies to form the Java Foundation Classes.
Eventually, Sun incorporated IFC technology into "Swing," augmenting it with a flexible look and feel system for widgets.
Since IFC's functionality was merged into both Swing and Java 2D, it is no longer actively supported or developed.
Differences from Swing
Many characteristics of IFC were carried over into Swing:
- In contrast to the AWT, IFC was implemented entirely in pure Java, which made it independent of browsers at that time.
- IFC introduced two types of Layout managers that were later standardized within the JDK.
- Certain IFC components had the capability to display HTML content sourced from URLs, though this functionality was not consistently reliable.
Swing enhanced these concepts by:
- Implementing a true Model-View design pattern.
- Decoupling the visual representation from component logic, thereby supporting customizable Look and feel, unlike IFC where these aspects were combined within components.
- Adhering to standard JavaBean practices; IFC employed a more complicated persistence approach that did not align with Java's built-in Serialization API.
- Providing a more sophisticated event handling system, whereas IFC’s event management was rudimentary and sometimes necessitated direct manipulation of the Event loop.
Hello World
Below is the traditional Hello world program written using IFC: <syntaxhighlight lang="java"> import netscape.application.*; import netscape.util.*;
public class HelloWorld extends Application {
public void init() {
super.init();
TextField textField = new TextField(100, 24, 128, 24);
textField.setStringValue("Hello World");
mainRootView().addSubview(textField);
}
public static void main(String args[]) {
HelloWorld app = new HelloWorld ();
ExternalWindow mainWindow = new ExternalWindow();
app.setMainRootView(mainWindow.rootView());
Size size = mainWindow.windowSizeForContentSize(320, 200);
mainWindow.sizeTo(size.width, size.height);
mainWindow.show();
app.run(); }
} </syntaxhighlight>
For reference, here is the corresponding code using Java Swing: <syntaxhighlight lang="java"> import javax.swing.*;
public class HelloWorld extends JFrame {
public HelloWorld() {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
add(new JLabel("Hello, World!"));
}
public static void main(String[] args) {
HelloWorld app = new HelloWorld();
app.pack();
app.setVisible(true);
}
} </syntaxhighlight>
External links
- Presentation on IFC
- Download page for IFC runtime
- Programming manual for IFC
- Class hierarchy of IFC
- IFC instructional guide
Archived download locations for IFC:
- Uni-Potsdam ftp server 1
- Uni-Potsdam ftp server 2
- Uni-Potsdam ftp server 3
- Ruhr-University Bochum ftp server
- SunSite ftp server
All accessible via
Complete IFC file archive:
Further IFC-related materials: