hi friends..i want to divide a frame into different parts...
how can i do that.....plz help me
A Frame is a component, and can accept other components.
Think of components as chunks of data that can store data of each other...
Here's the extension of JFrame
extended by java.awt.Component
extended by java.awt.Container
extended by java.awt.Window
extended by java.awt.Frame
extended by javax.swing.JFrame
JFrame IS-A component and IS-A container, and accepts containers. Containers also accept containers too!
Unfortunately you can't add another JFrame to your current JFrame contentpane since accessing windows without proper accessing rights is prohibited.
You can however create something like a Canvas, or GCanvas or even a seperate component/container to add to your JFrame. The way your component will be added to it will depend on your JFrame's LayoutManager.
There are several types of LayoutManagers, the most typical ones are--
--and the way you use them is nothing special. In your constructor for the JFrame object you're using you can simple make a statement like this--
this.setLayout(new GridLayout(2, 1)); //for a GridLayout //or this.setLayout(new FlowLayout()); //for the initial FlowLayout
the types of components you want to add to your JFrame can vary. If you want to divide your JFrame such that you are working with two different components you need to add onto the already-presented contentPane if there is one.
If there isn't then that's fine too. You can simply add to the opaque contentpane by sizing your component/container/canvas before calling the add() method then adding them to the pane.
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...