| I would like to open a frame with in a frame. |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- Arrays - component type vs Element typeCan anyone explain to me the difference between an element type and a
component type?
In the java literature, arrays are said to have component types, whereas
collections from the Collections Framework are said to have an element
type.
http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html
states:
> The *component type* of an array may itself be an array type. The components of
> such an array may contain references to subarrays. If, starting from any
> array type, one considers its component type, and then (if that is also an
> array type) the component type of that type, and so on, eventually one must
> reach a component type that is not an array type; this is called the *element
> type* of the original array, and the components at this level of the data
> structure are called the elements of the original array.
Reading that - I thought I'd 'got' the difference, but then in 10.1 (a
para later) the terms seem to used synonomously!
> An array type is written as the name of an *element type* followed by some
> number of empty pairs of square brackets []. The number of bracket pairs
> indicates the depth of array nesting. An array's length is not part of its
> type.
> The element type of an array may be any type, whether primitive or reference.
> In particular:
>
> € Arrays with an interface type as the *component type* are allowed. The
> elements of such an array may have as their value a null reference or
> instances of any type that implements the interface.
> € Arrays with an abstract class type as the *component type* are allowed.
> The elements of such an array may have as their value a null reference or
> instances of any subclass of the abstract class that is not itself
> abstract.
When describing collections from the Collections framework there is
never any of this ambiguity/distinction - it is always "element type",
even when talking about a collection whose elements are themselves
collections.
Am I missing a "big idea"?
Any thoughts greatly appreciated.
Rob
email***@***.com
- 6
- Socializing site EXCLUSIVELY for TECHIESTechnopax.com, (http://www.technopax.com) the first socializing web
portal exclusively catering to the IT Professionals world over is
launched.
This web portal will be a common online platform for IT industry
related professionals. Technopax.com primarily targets computer
software and hardware professionals, networking & system
administrators, nano Technologists, bio-technologists, graphics &
animation designers, BPO/Call Center/ITES employees, telecom experts,
employees of IT Departments of all business organizations and
technology students etc as its members.
According to the promoters, an online platform exclusively for Techies
will improve their technical and professional skills through the
sharing of knowledge base, methodologies and skill sets. Apart from
building vast friends circle, this will also help them to be abreast
with the latest developments that happen in the tech front world over.
Technopax.com has many features for the members to collaborate and
socialize. It has text/audio and video chat, online clubs, events,
forums, classified advertisements, discussion rooms, music and video
sharing, web profiles etc. Please verify.
- 7
- Help sought trying to add java to mozilla 1.5
I've downloaded and gotten mozilla 1.5 to work on my desktop machine.
However, when I visit Java enabled sites, I get a popup that tells
me I am missing the plugin for the java-vm applet type. When I say
"download it", the only links are for windows and linux, and I'm
not using either of these.
In the java 1.4.2_01 directory I have on my machine is a rje/plugin/sparc/ns610
directory in which there is a .so file. But I don't see any instructions
on what all I need to connect things together.
When I try to copy that .so file into my $HOME/.mozilla/plugins directory,
mozilla 1.5 crashes attempting to access the java applets. If I
remove the .so, then I get a popup telling me I need a plugin.
Can anyone provide additional ideas on what might be missing?
--
<URL: http://wiki.tcl.tk/ > In God we trust.
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:email***@***.com > <URL: http://www.purl.org/NET/lvirden/ >
- 7
- basic question on Java in XPHello,
can someone please tell me how to ascertain what version (if any) of Java is
installed in a WinXP platform?
my friend needs some kind of Java module installed so that she can do a
tutorial for an online registration service.
any help would be appreciated.
Cynthia
- 7
- odd mouselistener issueHi Guys
I'm probably doing something stupid... but:
I've got a JFrame with borderlayout. In the centre box, I've got a
JPanel. If I add a mouselistener to the jframe, it works fine (but
I've got coords relative to the frame which is correct but not what I
want - I want coords relative to the panel). However, when I add the
mouselistener to the panel, I get no mouseevents being returned at all.
Any ideas in what way I might be being stupid?
TIA
Peter.
- 7
- arrays of generic typesEclipse tells me that arrays of generic types are not legal, e.g.: it
won't allow the following:
QuadTree<MyNodeType> [] allQuadTrees;
Anyone know why this is the case?
- 7
- Can I restrict permissions at runtime?I have an editor application that I've writen that needs to read and
write XML files to disk. I'd like to extend this program by allowing
users to extend my editor by plugging in custom code they compile using
certain interfaces. My editor will call their code to gain use of
their functions.
However, this plugin code is untrusted, and I don't want it to access
the filesystem or network. Is there some way I can create a sandbox
within my program in which I can run this custom code and be sure that
it cannot do things like write to the filesystem? Perhaps create a
separate thread with special restricted permissions?
Mark McKay
- 7
- writing java daemon server: start and stopDear everyone,
I am trying to write a server program to do some monitoring.
I am using Windows 2000 platform.
I've seen that there is some server program can start server by
specifying command like "server start" and stop it like "server stop".
I am wondering how to do it in java language since java is running in
the JVM.
1. Is it prossible to send signal to kill the process just like c lang
?
2. Do java have process ?
3. How about if java thread can be killed by those deprecated method
like thread.stop(), can I find the current running thread and stop it
?
4. Any suggested method to do the server stop which can stop the
current running java program in JVM ?
Thank you for helping
Calvin
- 7
- What will be your DAO design ?For the following tables, which is a general rdbms design, what classes will
you create for accessing these tables ?
Table 1 : Group
group_id (PK)
group_desc
Table 2 : User
user_id (PK)
user_name
Table 3 : Group_User
group_id (FK)
user_id (FK)
- 8
- Java Newbie Question: Character Sets, Unicode, et al [Long]Roedy Green wrote:
> Ve need some definitions that make clear the distinction between:
> an character set,
> a character
> a glyph
> a font
> an encoding.
I'll take a stab at it.
I decided to see what Unicode had to say on the matter. That seemed
relevant, but may have been a mistake. In any event, here are some
possibly relevant defintions from the Unicode 4.0 glossary
(http://www.unicode.org/glossary/):
==== From the Unicode 4.0 Glossary ====
Abstract Character. A unit of information used for the organization,
control, or representation of textual data. (See Definition D3 in
Section 3.3, Characters and Coded Representations .)
Character. (1) The smallest component of written language that has
semantic value; refers to the abstract meaning and/or shape, rather than
a specific shape (see also glyph), though in code tables some form of
visual representation is essential for the reader's understanding. (2)
Synonym for abstract character. (See Definition D3 in Section 3.3,
Characters and Coded Representations .) (3) The basic unit of encoding
for the Unicode character encoding. (4) The English name for the
ideographic written elements of Chinese origin. (See ideograph (2).)
Character Encoding Form. Mapping from a character set definition to the
actual code units used to represent the data.
Character Encoding Scheme. A character encoding form plus byte
serialization. There are seven character encoding schemes in Unicode:
UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE and UTF-32LE.
Character Set. A collection of elements used to represent textual
information.
Coded Character Set. A character set in which each character is assigned
a numeric code point. Frequently abbreviated as character set, charset,
or code set.
Code Point. (1) A numerical index (or position) in an encoding table
used for encoding characters. (2) Synonym for Unicode scalar value.
Code Unit. The minimal bit combination that can represent a unit of
encoded text for processing or interchange. (See Definition D5 in
Section 3.3, Characters and Coded Representations .)
Encoded Character. An abstract character together with its associated
Unicode scalar value (code point). By itself, an abstract character has
no numerical value, but the process of "encoding a character" associates
a particular Unicode scalar value with a particular abstract character,
thereby resulting in an "encoded character."
Encoding Form. (See character encoding form.)
Encoding Scheme. (See character encoding scheme.)
Font. A collection of glyphs used for the visual depiction of character
data. A font is often associated with a set of parameters (for example,
size, posture, weight, and serifness), which, when set to particular
values, generate a collection of imagable glyphs.
Glyph. (1) An abstract form that represents one or more glyph images.
(2) A synonym for glyph image. In displaying Unicode character data, one
or more glyphs may be selected to depict a particular character. These
glyphs are selected by a rendering engine during composition and layout
processing. (See also character.)
Glyph Image. The actual, concrete image of a glyph representation having
been rasterized or otherwise imaged onto some display surface.
==== End of Glossary Excerpt ====
Note: the glossary does not contain a definition of "character
encoding", but it seems to be used in the Unicode context as an
abbreviation for "character encoding form" (_not_ "character encoding
scheme").
The Java documentation is a bit confused and inconsistent in its
terminology with respect to characters, character sets, and character
encodings. For instance "the Java platform uses Unicode as its native
character encoding" (i18n docs), but at the same time UTF-8 and UTF-16
are referred to as "character encodings" that all Java implementations
must support. Elsewhere in the docs these are the names of "charsets",
which is to say that in some places the docs call them "encodings" and
in others "charsets." Moreover, in Java 1.4 there is now
java.nio.charset.Charset, "A named mapping between sequences of
sixteen-bit Unicode characters and sequences of bytes." This is
consistent with MIME, but different from Unicode usage (which would call
such a thing a "character encoding scheme", except that it also implies
a certain collection of characters to which it can apply).
RFC 2045 (MIME) says, in part:
NOTE: The term "character set" was originally to describe such
straightforward schemes as US-ASCII and ISO-8859-1 which have a
simple one-to-one mapping from single octets to single characters.
Multi-octet coded character sets and switching techniques make the
situation more complex. For example, some communities use the term
"character encoding" for what MIME calls a "character set", while
using the phrase "coded character set" to denote an abstract mapping
from integers (not octets) to characters.
That describes terminology similar to Unicode's current terminology, but
not exactly the same.
Java documentation has also changed over the years with regard to how it
names these things.
What a muddle.
As this is a Java newsgroup, we are stuck with the inconsistencies of
the Java documentation, at least to some extent. We are also stuck with
the ambiguity of some of our terms (note, for instance, the four (four!)
different definitions of "character" above -- I find that I personally
use the word in each of those ways). On the other hand, there seem to
be some points on which there is little disagreement (at least in
official douments) such as a "font" as a collection of glyphs, a "glyph"
as a depiction of a character, and a definite distinction between glyphs
and characters (whatever those are).
Luckilly, in a Java context there is little call for usage of the term
"character set" in the Unicode sense, so it seems reasonable and
appropriate that in this venue we should use it in the MIME / Java NIO
sense (as defined by java.nio.charset.Charset.) "Charset" is a synonym.
By an "encoding" or "character encoding", I think we generally mean what
Unicode calls a "character encoding scheme" with the implicit
recognition that in a Java context the "character encoding form" is the
one defined by Unicode. This is closely related to a "charset" as
defined in the previous paragraph.
That leaves only "character" of the five terms of interest, and I don't
think I can do much better than the Unicode glossary there, except to
note the existence of class java.lang.Character, a related but distinct
entity. A character is definitely distinct from a glyph -- the latter
is a possible representation (or part of one) of the former, for some of
the defintions of the former.
John Bollinger
email***@***.com
- 8
- Making a soundcard objectI have this idea of making a modem, that requires the soundcard to act
as my A/D and D/A, and in the middle will be my attempts at DSP. I
came up with this object, and it seems to test OK, but I could use
some constructive criticism, as I am definately at the OO 101 stage.
Merry Christmas, and a Happy New Years soon!
/**
* SoundCard.java
*
* @version 1.0, 1 December 2007
* @author Steve Sampson, K5OKC
*
* Public Domain (p) December 2007
*/
package modem;
import javax.sound.sampled.*;
import java.io.*;
public class SoundCard {
private static AudioFormat format;
private static TargetDataLine targetLine;
private static SourceDataLine sourceLine;
private static AudioInputStream sound;
public void SoundCard() {
}
/*
* Initialize Sound Card
*/
public boolean initPCM(double dblSampleRate) {
/*
* Encoding,
* Sample Rate (float),
* Sample Size (In Bits),
* Channels,
* Frame Size,
* Frame Rate (float),
* BigEndian (Boolean)
*/
format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
(float)dblSampleRate,
16,
1,
2,
(float)dblSampleRate,
false);
DataLine.Info targetInfo = new
DataLine.Info(TargetDataLine.class, format);
DataLine.Info sourceInfo = new
DataLine.Info(SourceDataLine.class, format);
try {
/*
* A source data line is written to
*/
sourceLine =
(SourceDataLine)AudioSystem.getLine(sourceInfo);
sourceLine.open(format); // Typical buffer size is same
as samplerate in bytes
sourceLine.start();
/*
* A target data line is read from
*/
targetLine =
(TargetDataLine)AudioSystem.getLine(targetInfo);
targetLine.open(format); // Typical buffer size is same
as samplerate in bytes
targetLine.start();
}
catch (LineUnavailableException e1) {
return false;
}
catch (SecurityException e2) {
return false;
}
catch (IllegalArgumentException e3) {
return false;
}
catch (IllegalStateException e4) {
return false;
}
if(!AudioSystem.isLineSupported(targetInfo)) {
return false;
}
sound = new AudioInputStream(targetLine);
return true;
}
/*
* Stop, flush, and close the soundcard interface
*/
public void closePCM() {
sourceLine.stop();
targetLine.stop();
sourceLine.flush();
targetLine.flush();
try {
sourceLine.close();
targetLine.close();
}
catch (SecurityException e)
{
}
}
/*
* Provide a block of Signed 16 bit PCM sound data
*/
public int getPCM(int[] intSampleArray) {
int intBytesRead;
byte[] byteData = new byte[intSampleArray.length * 2]; //
Convert count to bytes
/*
* Read bytes into array. This call will block if there aren't
* enough requested bytes.
*/
try {
intBytesRead = sound.read(byteData, 0, byteData.length);
} catch(IOException e) {
return -1;
}
/*
* This is designed for Little-Endian Intel machines
*/
for (int i = 0, j = 0; i < intBytesRead; i += 2, j++)
intSampleArray[j] = (byteData[i + 1] << 8) + byteData[i];
return intBytesRead / 2; // convert count to words
}
}
- 9
- Help with JavaPOS pleaseHi there,
I have made an application that uses a POS printer device to print out a
receipt,
but there are genereal problems printing out .....
sometimes it prints out sometimes it doesn't (??) this is not the most major
of the
problems. The most major problem has to do with setting the style and the
layout of the printing.
After I have opened my device, claimed it everything should be ready or ??
I have checked to see what the method getFontTypefaceList()); returns
and my guess was that these numbers return different numbers that are
representatives for character sets eg fonts!!!! So I take one of these
numbers to try it out, put a number inside the method setCharacterSet(850);
yes .. 850 for instamce ... then I restart my application to see if the
output
is different, but it is not. I wonder why.
and yes I have tried several other methods in the POSprinter class and
by means of the POSprinterConst class too.
Does anyone have any experience with this or am I left to keep
experimenting?
I also need to find out how to set Linebreaking, linedistancing etc etc bold
italic and so on.
Regards
Carl
- 13
- public static final - compilation errorOn Tue, 28 Jun 2005 17:49:11 +0200, Kamil Roman wrote:
> Hi,
>
> is it possible to initialize a public static final member of a class in
> the class' constructor? I try to do this and I receive error message:
>
> variable PLUS is declared final; cannot be assigned.
{... code ...]
No, the static finals need to be initialized before that. Why don't you
use a static initializer block (static { /* ... */ }), which would be
called at class load, in which you can initialize your members.
--
You can't run away forever,
But there's nothing wrong with getting a good head start.
--- Jim Steinman, "Rock and Roll Dreams Come Through"
- 14
- 9?. Steps To Improve Your FlyingThere are many things that you can do when you fly to make yourself a
safer and better pilot. Too many pilots get careless and stop doing
fundamental things that could save their lives. Here are some simple
things that you can do to improve your flying.
1. Use your rudder pedals.
It seems simple, right? Well, too many people neglect to get in the
good habit of using them. Use them during taxi, takeoff, climbs,
cruise, maneuvers, descents, and landing. Get the picture - Use them
all the time.
You can know exactly how much to use them during flight by looking at
the slip/skid indicator. That is the ball of the turn coordinator. As
long as the ball is centered between the lines, you are using the
right amount of rudder. If the ball is outside the lines, add rudder
in the direction that the ball is located.
For instance, if the ball is to the right, add right rudder. An easy
way to remember this is to "Step on the ball." Add enough pressure to
re-center the ball.
There are a lot of things happening when you are airborne. Correctly
using your rudder will make you a better pilot, keep your passengers
happy, and show your piloting professionalism (something you need to
have, even if you are not a professional pilot). Remember, step on the
ball.
2. Use Your Checklist
As you are flying, make sure that you use your checklist for each
portion of the flight. There are checklists for everything from
preflight to securing the airplane. Most airplanes have a checklist in
the owner's manual that you can use during your flights. Also, when
you learn to fly most flight schools have checklists that are
available for their students.
But checklists aren't put there to look pretty. Your job is to use
them. If you get in the habit of using one each flight, you will be
that much safer. It's not going to do you any good in your flight bag.
Even if you know the items by heart, still double check yourself
anyway.
Another thing, if you need to add something personal to your checklist
(like don't forget your sunglasses, or turn off your cell phone so the
battery won't run down as it searches for a signal in flight) do this
as well. As long as you have all the required items included, add any
that will help you personally during your flight.
3. G.U.M.P.S.
Whether you use G.U.M.P.S. as your landing checklist or not, get in
the habit of using a memorized checklist for your return to earth. In
a complex airplane, Gumps is; Gas, Undercarriage, Mixture, Propeller,
and Seatbelts. In a non-complex airplane, Gumps could be; Gas,
Undercarriage, Mixture, Power, and Seatbelts. Of course you don't
actually have to lower your gear on a fixed gear plane, but it is best
to remind yourself anyway. That way, when you do transfer to a
retractable gear airplane, you won't have to add anything to your
checklist. This also happens to be one of the most important checklist
items of the whole flight. So you will already be in the habit of
checking your landing gear when you get to the point where it really
matters.
4. Weight and Balance
Never ever forget to precisely calculate your weight and balance for
each flight. Too many people have gotten lazy and careless, and have
added extra weight in the form of passengers or cargo to their
airplanes, thinking that everything is ok. Isn't there room for error
- a little safety cushion, if you will - in the maximum useful load?
Why would you even want to know? If you take this attitude with your
flying, you are putting yourself and your passengers in a very
dangerous situation. Never operate out of the manufacturer's set
limitations for your airplane. They are there for a reason; to keep
you safe!
5. T.O.L.D.
Takeoff and Landing Data should be calculated for every flight as
well. Make sure that you are very familiar with all of the runways of
intended use and their lengths and widths. If it is not something that
you or your airplane can handle, don't make the flight. Don't get in
the habit of assuming that just because you are in a Cessna 172 that
every landing strip is suitable for your flight. Calculate your
takeoff and landing distances for each flight, taking into
consideration the density altitude and aircraft performance.
6. Appropriate Radio Calls
One flying safety item that can easily be performed is making sure
that you make your radio calls at the appropriate time. Whether you
are flying out of a towered or uncontrolled airport, be professional
with your radio calls. One common error is made at uncontrolled
airports, when after an airplane lands, the pilot calls clear of the
runway while part or all of the airplane is on the runway side of the
hold short line. This is dangerous! What if your airplane malfunctions
and you are stuck on the runway and another airplane thinks it's safe
to land? This is a hazardous situation that can easily be avoided. At
non-towered airports, it's better to not make any radio call at all,
than to make a dangerous one. Get it right!
7. Complete Runup
You have done a complete preflight inspection and are now ready to
takeoff. Make sure you do a complete engine runup as well. Check every
aircraft system while you are still on the ground before you get in
the air. Determine that all of your radios, comm and nav are
functioning. Check your vacuum and electric gyros. Check your flight
controls and your engine gauges. Know that when you take off, you are
as safe as you can be. There is no reason to rush through your runup.
8. Situational Awareness
Situational awareness is when you know exactly what is happening with
your flight and with what is going on around you. On the ground, you
need to make sure that you are aware of other airplanes that are
taxiing and using the runway. In the air, use the radio and your eyes
to know exactly where other airplanes are in relation to you as well
as their intentions. But situational awareness is not just limited to
knowing where other airplanes are. You also need to know exactly what
is happening with your airplane, the weather, airspace, the winds,
your location, what you would do in an emergency, etc. Regardless of
whether you are flying cross country or local, for fun or for
training, don't assume everything is alright. Know what is happening
around you.
9. Fly the plane from engine start to shutdown
When it comes to flying, make sure that you are maintaining vigilance
at all times in the airplane. Too many times pilots zone out at some
point in the flight. For many pilots, that time is before takeoff and
after landing. Make sure that even when you are on the ground, you are
flying the airplane. Keep a watchful eye out for other aircraft and
don't rely on the tower to separate ground traffic. Position your
flight controls so that you have the proper crosswind correction,
regardless of the wind speed. Even if the wind is calm, look at the
wind sock and taxi as if the wind is really blowing in the direction
indicated by the sock. Although you are on the ground, your control
surfaces are still somewhat effective. Treat them as if your safety
depends on their position.
9?. Have Fun
Even though it sounds simple, keep your flying fun. When you are in
the air, you are living a dream. Don't forget it!
http://cncarrental.cn/html/goodspeech/20060924/633.html
- 15
- ArrayList
Why this doesn't work:
ArrayList l = new ArrayList();
l.add(new String("aaa")));
String[] s = l.toArray();
JavaClassCast exception I got. What should I do?
|
| Author |
Message |
Richard Perreault

|
Posted: 2006-3-25 7:21:00 |
Top |
java-programmer, I would like to open a frame with in a frame.
I would like to open a frame with in a frame. I do not want to have seperate
class. Rather I would like to have one class with two frames. A little like
visual basic does.
|
| |
|
| |
 |
Big Jim

|
Posted: 2006-3-25 7:46:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
"Richard Perreault" <email***@***.com> wrote in message
news:A9%Uf.32111$email***@***.com...
>I would like to open a frame with in a frame. I do not want to have
>seperate class. Rather I would like to have one class with two frames. A
>little like visual basic does.
"class" and "frame" i.e. what gets displayed for a GUI have no real
relationship, you can have as many frames in a class as you like, you can
also have as many frames within frames displayed as your machine can handle,
can you be a bit more precise about what you want to do?
|
| |
|
| |
 |
Roedy Green

|
Posted: 2006-3-25 8:15:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
On Fri, 24 Mar 2006 18:21:02 -0500, "Richard Perreault"
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>I would like to open a frame with in a frame. I do not want to have seperate
>class. Rather I would like to have one class with two frames. A little like
>visual basic does.
You would have either two JWindows inside the JFrame or perhaps two
JPanels. The JWindows could be either dependent objects, in inner
classes, static classes or top level classes and many or may not
extend the JWindow/JPanel.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Richard Perreault

|
Posted: 2006-3-25 8:49:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
I do not use Jframe or JWindows. I just want to use a common Frame
such as this snipplet would have to be with in another frame.
I'm not sure if this is the proper way to do it.
import java.awt.*;
// Class About_Frame
public class About_Frame extends Frame
{
final int MenuBarHeight = 0;
boolean fForm_Create;
// Component Declaration
public Label Label1;
public Label Label2;
public Button Button1;
// End of Component Declaration
With in this Frame
import java.io.*;
import java.util.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import java.lang.*;
// Class finalapp
public class finalapp extends Frame implements Runnable
{
String url = "";
String http = "";
//Constructor
public finalapp(String Url,String HTTP,String title)
{
"Roedy Green" <email***@***.com> wrote in
message news:email***@***.com...
> On Fri, 24 Mar 2006 18:21:02 -0500, "Richard Perreault"
> <email***@***.com> wrote, quoted or indirectly quoted
> someone who said :
>
>>I would like to open a frame with in a frame. I do not want to have
>>seperate
>>class. Rather I would like to have one class with two frames. A little
>>like
>>visual basic does.
>
> You would have either two JWindows inside the JFrame or perhaps two
> JPanels. The JWindows could be either dependent objects, in inner
> classes, static classes or top level classes and many or may not
> extend the JWindow/JPanel.
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Richard Perreault

|
Posted: 2006-3-25 9:40:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
I do not want to use JWindows or JFrame I just want to use a simple Frame.
Such as these snipplet codes.
import java.awt.*;
// Class About_Frame
public class About_Frame extends Frame
{
final int MenuBarHeight = 0;
boolean fForm_Create;
// Component Declaration
public Label Label1;
public Label Label2;
public Button Button1;
// End of Component Declaration
With in this snipplet code
import java.io.*;
import java.util.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import java.lang.*;
// Class finalapp
public class finalapp extends Frame implements Runnable
{
String url = "";
String http = "";
Thank you
"Roedy Green" <email***@***.com> wrote in
message news:email***@***.com...
> On Fri, 24 Mar 2006 18:21:02 -0500, "Richard Perreault"
> <email***@***.com> wrote, quoted or indirectly quoted
> someone who said :
>
>>I would like to open a frame with in a frame. I do not want to have
>>seperate
>>class. Rather I would like to have one class with two frames. A little
>>like
>>visual basic does.
>
> You would have either two JWindows inside the JFrame or perhaps two
> JPanels. The JWindows could be either dependent objects, in inner
> classes, static classes or top level classes and many or may not
> extend the JWindow/JPanel.
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Big Jim

|
Posted: 2006-3-25 21:08:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
"Richard Perreault" <email***@***.com> wrote in message
news:gc1Vf.34414$email***@***.com...
>I do not want to use JWindows or JFrame I just want to use a simple Frame.
>Such as these snipplet codes.
>
> import java.awt.*;
>
> // Class About_Frame
> public class About_Frame extends Frame
> {
> final int MenuBarHeight = 0;
> boolean fForm_Create;
>
> // Component Declaration
> public Label Label1;
> public Label Label2;
> public Button Button1;
> // End of Component Declaration
>
> With in this snipplet code
>
> import java.io.*;
> import java.util.*;
> import java.awt.*;
> import java.net.*;
> import java.awt.event.*;
> import java.lang.*;
>
> // Class finalapp
> public class finalapp extends Frame implements Runnable
> {
> String url = "";
> String http = "";
>
> Thank you
>
> "Roedy Green" <email***@***.com> wrote in
> message news:email***@***.com...
>> On Fri, 24 Mar 2006 18:21:02 -0500, "Richard Perreault"
>> <email***@***.com> wrote, quoted or indirectly quoted
>> someone who said :
>>
>>>I would like to open a frame with in a frame. I do not want to have
>>>seperate
>>>class. Rather I would like to have one class with two frames. A little
>>>like
>>>visual basic does.
>>
>> You would have either two JWindows inside the JFrame or perhaps two
>> JPanels. The JWindows could be either dependent objects, in inner
>> classes, static classes or top level classes and many or may not
>> extend the JWindow/JPanel.
>> --
>> Canadian Mind Products, Roedy Green.
>> http://mindprod.com Java custom programming, consulting and coaching.
>
I still have no idea what you're really trying to do, could you give an
English description of what you're trying to do and what you want the end
result to be and look like?
|
| |
|
| |
 |
Richard Perreault

|
Posted: 2006-3-26 0:22:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
I will try to explain once again. I basically want to have a pop-up window
apear in a frame class.
This pop-up window is a about_frame once clicked on the menu file and about
on the frame class.
Is this a little bit clearer now?
"Big Jim" <email***@***.com> wrote in message
news:hhbVf.17510$email***@***.com...
>
> "Richard Perreault" <email***@***.com> wrote in message
> news:gc1Vf.34414$email***@***.com...
>>I do not want to use JWindows or JFrame I just want to use a simple Frame.
>>Such as these snipplet codes.
>>
>> import java.awt.*;
>>
>> // Class About_Frame
>> public class About_Frame extends Frame
>> {
>> final int MenuBarHeight = 0;
>> boolean fForm_Create;
>>
>> // Component Declaration
>> public Label Label1;
>> public Label Label2;
>> public Button Button1;
>> // End of Component Declaration
>>
>> With in this snipplet code
>>
>> import java.io.*;
>> import java.util.*;
>> import java.awt.*;
>> import java.net.*;
>> import java.awt.event.*;
>> import java.lang.*;
>>
>> // Class finalapp
>> public class finalapp extends Frame implements Runnable
>> {
>> String url = "";
>> String http = "";
>>
>> Thank you
>>
>> "Roedy Green" <email***@***.com> wrote in
>> message news:email***@***.com...
>>> On Fri, 24 Mar 2006 18:21:02 -0500, "Richard Perreault"
>>> <email***@***.com> wrote, quoted or indirectly quoted
>>> someone who said :
>>>
>>>>I would like to open a frame with in a frame. I do not want to have
>>>>seperate
>>>>class. Rather I would like to have one class with two frames. A little
>>>>like
>>>>visual basic does.
>>>
>>> You would have either two JWindows inside the JFrame or perhaps two
>>> JPanels. The JWindows could be either dependent objects, in inner
>>> classes, static classes or top level classes and many or may not
>>> extend the JWindow/JPanel.
>>> --
>>> Canadian Mind Products, Roedy Green.
>>> http://mindprod.com Java custom programming, consulting and coaching.
>>
> I still have no idea what you're really trying to do, could you give an
> English description of what you're trying to do and what you want the end
> result to be and look like?
>
|
| |
|
| |
 |
armelnene

|
Posted: 2006-3-26 0:46:00 |
Top |
java-programmer >> I would like to open a frame with in a frame.
I understand that you want to have a frame that will popup and display
something about your application or programmer. The easiest way to do
this is to use a JFrame with a JLayeredPAne and JInternalFrame. Using a
Frame class you can you a dialogBox to display your message on top of
your main frame. My advise will be to you to use a dialog box because
you can't add a frame to a frame because this is parent component. I
hope that helped
www.etapix.com
London Computer Consultant
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Opportunities in U.K./Great Britain?I have a friend who recently moved to Madrid. He had a Dutch passport
so EU access was relatively easy for him. We both lived in D.C., but
I remain US citizen by birth.
My question is, he says it's becoming more popular for J2EE
development in Great
Britain and the UK. I'm wondering how good is the market? (in
relation to US) How good is it for US programmers? (any demand for US
borne skills) And if any of these are true, how hard it is securing
work permit? (etc) Finally is there any idea what standard of living
might be like?
Given all of this would there be sacrifices, or would it just be
better overall simply to stay in US?
- 2
- List helpHi,
I am new to Java.
I've been working on this project for some time now and I cannot get it
to work.
This is supposed to be a linked list.
I need to use an insert method that alphabetically adds a new title to
the list. This code I have here doesn't have a working compareTo method
but only a test to add node to the list.
This code was provided to me and I must add an insert that will put a new
item in alphabetically order. Don't tell me the answer - I just don't
understand why this doesn't work. I hope that what I've written here is
clear.
Thanks
John
Main looks like this something like this:
main(String [] args){
BookList book = new BookList();
book.add (new Book ("title of book"));
}
// ----------------Test compareTo
public int compareTo(Node a, Node b){
// Since I couldn't get this to work either, I test to see if I can get
any value.
println(a.book.compareTo(b.book)); // doesn't work I don't know how to
compare the titles
return 0;
}
public class BookList
{
private BookNode head;
//----------------------------------------------------------------
// Sets up an initially empty list of books.
//----------------------------------------------------------------
BookList()
{
head = null;
}
//----------------------------------------------------------------
// Creates a new Book object and adds it to the end of
// the linked list.
//----------------------------------------------------------------
public void insert (Book newBook){
BookNode node = new BookNode (newBook);
BookNode current;
BookNode prev;
if (head == null)
head = node;
else
{
current = head;
while (current.next != null){
// Orignally this method looped through the whole list until it found the
end, then add the new
// to the bottom.
// I did a test here to see if I could move the list around.
// This is what I think should happen: save current in prev. get next with
current.
// try to put node in from of current.next. It seems no matter what I try
there's a null pointer
// error. I just can't figure this out.
prev = current;
current = current.next;
node.prev = current.prev;
node.next = current;
node.prev.next = node;
current.prev = node;
}
current.next = node;
}
}
//*****************************************************************
// An inner class that represents a node in the book list. The
// public variables are accessed by the BookList class.
//*****************************************************************
private class BookNode
{
public Book book;
public BookNode next;
public BookNode prev;
//--------------------------------------------------------------
// Sets up the node
//--------------------------------------------------------------
public BookNode (Book theBook)
{
book = theBook;
next = null;
prev = null;
}
}
}
- 3
- Problem with IN parameters to an Oracle stored procedureHello all
I had earlier posted the same problem I am having on
comp.java.lang.programmer earlier and someone suggested this post
would probably fall better under this group. Here is the link to the
original post with the original post copy pasted below.
http://groups.google.co.in/group/comp.lang.java.programmer/browse_thread/thread/b0b845981c3e403a/#
Since then I have changed the IN parameter to my stored procedure to
read as
clID IN TABLEA.CLIENTID%TYPE
instead of clientID, based on a suggestion to the earlier post and
have still had no luck.
Any suggestions are welcome.
Thanks
Swetha
- 4
- Play audio clip in an ApplicationI'm trying to play an audio clip by using Applet's newAudioClip()
method. That method takes a URL. The .wav file is located in a jar file
(the only jar file). For example:
if myJar.jar is the only jar file
"java -jar myJar.jar" launches the application correctly and everything
is wonderful. My audio clip won't play because I don't know how to
access the .wav file from the jar file.
This code snippet works fine when I'm not running from the jar file:
try
{
File currentDir = new File(".");
URL currentDirURL = currentDir.toURL();
URL url = new URL(currentDirURL, fileName);
AudioClip clip = Applet.newAudioClip(url);
clip.play();
}
catch (Exception e)
{
e.printStackTrace();
}
It knows to look for the sound file in the current directory. How do I
adjust this code to look for the sound file in the jar.
I have a feeling it's an easy answer involving class.getResource().....
- 5
- using jsp:setProperty on non-simple types.Hi,
I'm currently having a small problem with my application. I'm using
some simple classes that wraps simple types to help me provide multiple
representation. For example, a DateCBO calls wraps the Date type and
gives me the oportunity to have various 'getters' like
getDateShortFormat(), getHtml(), getDateLongFormat() and so on.
My beans are using this kind of wrappers as their properties.
I have already made a custom tag to retrieve information that i use
instead of the standard jsp:getProperty
Now, i'm trying to use the jsp:setProperty to initialise the bean
property, but i have 'Could not coerce String to non-primitive type
StringCBO without bean property editor (JSP 1.2: 2.13.2.1) at line 13'
error.
Is there an interface that i can use to allow direct usage of
'jsp:setProperty', or should i create a custom tag as well.
thanks.
- 6
- Send ARPHello everyone,
I want to verify if an IP is in my local net or not.
If I send an ARP request and get a MAC from that then the IP is in the
local net.
That's why I need to send an ARP request in Java under Windows XP and
NT.
Can anyone tell my how this is done?
Doing this native with the Windows iphlpapi.dll seems to be a bit
complex.
Any ideas for any easy way?
Thanks.
bye bembi
- 7
- tomcatI just installed Tomcat 5.5 and went to http://127.0.0.1:8080/. Then I
clicked on Servlet Examples to see what examples it comes with, but I
got a 404 File not found error. Anyone know what the deal is? Are the
servlet examples separate?
- 8
- 9
- History of objects?Hi
a relatively complex project I am working on now has a need for
"versioning". I mean, we have a system for administration of data (creating
and updating) in a database, and this data needs to be saved as separate
versions each time it is updated - a lot like a CVS.
The data is in the main "bridges", which have lots of data (name, location,
height etc), and lots of related data: persons (controller, supervisor);
tasks to be performed...
It should for example be possible for a user to view a "bridge" as it looked
on a certain date in the past, with all its related data (as they also were
at that date).
Does anyone have some good ideas about how we can save a history of versions
of all our objects? Where can I start to look for good ideas? Could we use
CVS via some sort of java api?
Thanks,
Peter
- 10
- load servlet mappings at runtime in tomcatCan anyone suggest a way to achieve dynamic servlet mappings in tomcat 5.5.
What I want to do is run a web app with any number of paths all pointing to
one servlet. These paths would be loaded from a database and extra paths
can be added at runtime by the user. So an example would be
www.domain.com/sample and www.domain.com/anothersample would both execute
the same servlet.
Another option I thought of was having a custom 404 servlet that would check
the request supplied and then redirect.
- 11
- ain't java grand ?I just got this error message from the java 4.2 compiler.
---
Consulting.java:152: cannot resolve symbol
symbol : variable $
location: class Consulting
perchance you meant '.'
---
Ain't it just the coolest message you've ever seen?
- 12
- Toward more efficient ArrayListsRoedy Green (email***@***.com) wrote:
: IIRC Arraylists are about 10 times slower than plain arrays. This is
: quite a penalty to pay for not knowing ahead of time how many items
: you will have.
Can you give a pointer to a benchmark that shows this?
Or can you build a benchmark that shows this?
Can you give proof that this really is your hot spot? Most guesses
about what to optimize is wrong.
Anyway I find it hard to believe that arraylist is 10 times slower
since the methods (get and set) does something like
{ RangeCheck(index); return elementData[index]; }.
Ok the range check is unneccasry, it will be checked by the jvm also.
If you use add a lot then it will check the size of the array and
expand if neccessary. If you know in advance how many objects you will
store this should not be a problem (you do create the list with the
size), if you dont know in advance it will be hard to write something
that is a magnitude faster...
/robo
- 13
- Beans with JSFI'm pretty new to programming with JSF and beans, and have been
reading up the documentation in the book "Core JavaServer Faces"
by D.Geary and C. Horstmann as well as online, and managed to
get some simple programs to run, so at least I now understand
some of the basics.
However, I've got quite a lot of existing code in HTML and
JavaScript that works, although not fully cleaned up yet, and I want
to make as few changes as possible in order to modify it for using
beans with JSF. Specifically, some months ago I wrote some
client-side code which is backed up online at
http://csharp.com/simulator/simulator.html, which I'm in the process
of modifying for JSF. The links at the bottom take you to
.../option1.html and .../option2.html, with the original source code
at
respectively .../option1.txt and .../option2.txt. At the moment the
code is not linked to code on a server, so only the JavaScript works
with the forms.
The index page didn't need much work, with the main change being
to include the JSF tags at the top (I'm leaving work on the counter
until later). The option1 page is mostly one large form, and what I
have since done is to keep the form as it is, except that it only
operates with JavaScript, with the post, action, and JavaScript
function calls at the beginning removed, together with the "Submit"
and "Reset" buttons at the end. I put these two buttons together
with calls to the JavaScript in a JSF form immediately below the
end of original form, and after making a few changes to the
JavaScript, got the JavaScript to work correctly and validate the
form.
My question is how do I send to the server the contents of the
original form, including the hidden fields? Do I have to create a
hidden field in the JSF form for each value entered in the main form,
and create a bean for each of these values, or is there some way
of sending the whole contents of the form to a bean, which can then
parse the values. I want to avoid turning the original form into a
JSF form, as it would probably mean making many changes to the
JavaScript, which would require extra work and debugging.
Exactly the same will be done with the option2 page once option1
has been sorted out, and I would be most grateful for some advice.
Christopher Sharp
- 14
- ... to see if I can post ...
I attempted to respond to the response to my latest post,
or to thank him twice, but not shown. What is going on?
- 15
- want to sort tables inside a complex mechanism, what can be the approach?I have a situation where first we are fecthing some ids(list of say
version ids using hibernate form database)
then keeping those list of data in a Pager Object(Paging mechanism
displays 100 rows per page out of complete sa 100 or so.)
This pager class does two things one takes whole list of ids
(Collection of version_id).
(Every time based on search criteria it changes. For searching in
hibernate values are hardcoded. Want modification with minimal changes
as many things are interrelated here.)
and other thing it checks no. of contents based on that displays data
per page(100 here).
It means stores all data from database and send it oage by page.(First
thing to notice)
Next all this is getting stored in Report page where it searches other
column names based on ids(version_id) the other column names are
getting changed for different requests so what we do is take all other
columns collectAllExtraFields(this is also getting changed everytime
based on what is getting searched.)
Now all this is getting accumulated while displaying but as we know
what to display we hardcoded all fields required to display based on
search. But all fields are searched based on the id fetched from
database first time which Pages is storing.
like this
Search for product user information & retrun results in the form of a
paged table for components used by specific product
ComponentVersion versionObj =
versionHandler.getComponentVersion(versionId);
String CAUsers = ctHelp.getCAUsersSection(versionId);
tableBody = tableBody + ((i%2 == 0) ? "<tr
class='table_banded_row' valign='top'>" : "<tr class='table_row'
valign='top'>");
tableBody = tableBody + "<td class='table_data'>" +
procHelper.getCompVersionLink(versionId,
versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
tableBody = tableBody + "<td class='table_data'>" +
CAUsers + "</td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getComponent().getType() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getComponent().getVendor() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span
class='data'>" +
versionObj.getRecommendationType() + "</span></td>";
tableBody = tableBody + "</tr>";
/** Get ComponentVersion ID with hyperlink to ComponentVersion Detail
page
*/
public String getCompVersionLink(long versionId, String compName,
String compVersion){
return "<a class='datalink' title='" +
this.getComponentFlyOverText(versionId) + "'
href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId="
+ versionId + "'>" + compName + " " + compVersion + "</a>";
}
this is getting called by Report.jsp to display.
As this is getting changed everytime its called form classes not used
in jsp directly i think.
Now original objective is to sort all these displayed columns.
If user clicks on any of the column name everything sholud get sorted
on that basis.but sholud not call databse for same again by using same
id and mapping with any new column name this sholud be done. Paging
mechinasm to be used as it is if possible without major changes.
i don't know where to start with as started looking on this code just
2-3 days back only.
Vj
|
|
|