background preloader

JAVA

Facebook Twitter

Programming

Programming. OOPWeb.com. B-Trees. Introduction Tree structures support various basic dynamic set operations including Search, Predecessor, Successor, Minimum, Maximum, Insert, and Delete in time proportional to the height of the tree. Ideally, a tree will be balanced and the height will be log n where n is the number of nodes in the tree. To ensure that the height of the tree is as small as possible and therefore provide the best running time, a balanced tree structure like a red-black tree, AVL tree, or b-tree must be used.

When working with large sets of data, it is often not possible or desirable to maintain the entire structure in primary storage (RAM). Instead, a relatively small portion of the data structure is maintained in primary storage, and additional data is read from secondary storage as needed. B-trees are balanced trees that are optimized for situations when part or all of the tree must be maintained in secondary storage such as a magnetic disk. The Structure of B-Trees Height of B-Trees B-Tree-Search(x, k) How to Write a Custom Swing Component. When you hear comparisons between AWT and Swing components, one of the first points mentioned is that Swing is lightweight. What this essentially means is that there are no real native controls "behind" Swing buttons, internal frames, and menus.

Everything is controlled in pure Java, including rendering and event handling. While this provides a much more flexible way to create truly platform-independent components, the task of creating a custom Swing component that has a consistent look across all platforms and look-and-feels is not an easy one. This article walks through the process of creating a new Swing component of medium complexity and highlights the important points, steps, and pitfalls along the way. Basic Building Blocks The Swing architecture overview provides an excellent high-level overview of the architectural decisions that were made during the development of Swing. The main building blocks of all core Swing components are: Figure 1. The Component Class: UI Delegate Plumbing. Paola Magillo, Univestita' di Genova, Corso di Interfacce Utente per Informatica, a.a. 2002-2003.

[Per corso su Java vedere Gestione degli eventi in Java Classi per gli eventi Classi event listener, che definiscono modi di reagire a eventi di una certa classe Parte di AWT, usate anche in Swing. Classi di eventi Gli eventi sono classificati a seconda della loro causa scatenante, che puo' essere: un'azione fisica: cliccare mouse, muovere mouse, premere tasto su tastiera... Classi di eventi hanno nomi del tipo XXXEvent dove XXX e' la causa. Ogni classe di componente e' una potenziale sorgente di certe classi di eventi. Event listeners Posso registrare un event listener per ricevere eventi di una certa classe da una certa componente dell'interfaccia.

Vi e' un'interfaccia event listener per ogni classe di evento: classe evento: XXXEventlistener: XXXListener Esempio: voglio catturare azionamento di un bottone. Implementare un listener Listener e adapter Font. Java Programming Notes. KickJava.com: Java API By Example, From Geeks To Geeks. 20.3.5.1 Basic JDBC Concepts. PreciseJava.com - The path to improvement.