Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
jcomponent
- Page 1
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
… ContentViewer cv; //components to resize private static ArrayList<
JComponent
> components; // JFrame to resize to private static …at once */ public FrameResizeHandler(JFrame jf,
JComponent
jc){ watching = jf; components = new ArrayList<
JComponent
>(); components.add(jc); width =…
JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
Hi. When I add a
JComponent
to my JFrame, it isn't the size of the remaining space in the frame. I want it to work in a way so that when i add a
JComponent
, it (and it's contents) stretches to fill the remaining space in the screen... Is there anyway to do that?
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by VernonDozier
[QUOTE=llemes4011;906810]Hi. When I add a
JComponent
to my JFrame, it isn't the size of the … work in a way so that when i add a
JComponent
, it (and it's contents) stretches to fill the remaining…
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
… thread that has static copies of the JFrame and the
JComponent
, and is always watching to see if the height or… width is changing, then resizes the
JComponent
. I don't know it that is the way it…
Re: Why will Jcomponent Have add() And Remove() ways however part will Not?
Programming
Computer Science
5 Years Ago
by JamesCherrill
JComponent
is the base class for all Swing components except the …
JTextField in JComponent
Programming
Software Development
15 Years Ago
by llemes4011
…. I have a predicament... I'm trying to make a
JComponent
that looks like this: _____________________ | | |Option Name [Text Field] | |____________________…to fix this? [CODE="Java"] class JKeySetter extends
JComponent
implements KeyListener { // Values that decide what key is linked to…
Re: Problem with JPanel and JComponent
Programming
Software Development
14 Years Ago
by joshmo
… was trying to use a
JComponent
instead of Component since the getVisiaualComponent() method is not availble with
JComponent
...PS these are two… diffrerent problems prob 1- using
JComponent
instead of Component with a player or processor in JMK …
Not able to set the background color of JComponent
Programming
Software Development
17 Years Ago
by jk1998
… not the currentSurface which is an instance of PaintSurface extends
JComponent
. Could someone please help me out? Many thanks [code] import… c) { this.c = c; } public void run() { } } class PaintSurface extends
JComponent
{ String figure; public PaintSurface() { } public void paint(Graphics g) { Graphics2D…
Problem with JPanel and JComponent
Programming
Software Development
14 Years Ago
by joshmo
… cannot find anyway I can make my player return a
JComponent
..tried this casting but Iam getting an exception at the… line. [code=java]((com = (
JComponent
)p.getVisualComponent()) != null)[/code] I also got to see something…
Re: Problem with JPanel and JComponent
Programming
Software Development
14 Years Ago
by peter_budo
[code=Java]((com = (
JComponent
)p.getVisualComponent()) != null)[/code] What you trying to achieve with this line? Are you trying to assign
JComponent
to com variable if result is not null? I do not think second part sufficient to locate problem. PS: It is not recommended to mix SWING and AWT.
JFrame and JComponent
Programming
Software Development
13 Years Ago
by theurbanist
Hey Everyone, How would you go about writing a program that draws an image of an ice cream cone, using JFrame and
JComponent
classes, with a triangle on bottom and a circle on top?
Re: JFrame and JComponent
Programming
Software Development
13 Years Ago
by Akill10
You would need a JFrame and a
JComponent
and some type of paint method. [url]http://java.sun.com/products/jfc/tsc/articles/painting/[/url]
Why will Jcomponent Have add() And Remove() ways however part will Not?
Programming
Computer Science
5 Years Ago
by dukoolsharma
Why the part will not have add() and remove() ways whereas
Jcomponent
Have add() And Remove() ways?
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
VernonDozier>What LayoutManager are you using? llemes4011>I'm not... But I found a way that works. Can I see the way you have used? Do you know BorderLayout, GridBagLayout & GridBagConstraints?
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
Use BorderLayout and add a component with CENTER position. Do not forget to issue validate() method of container after component has been added to that container.
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
I tried that and it didn't resize it. ( I tried it as a JPanel too...)
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
Please post complete code with bb code tags.
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
Okay, Here's what I have: [CODE="Java"] package JEmail.util; import java.awt.*; import javax.swing.*; public class ContentViewer extends JPanel { public ContentViewer(){ createAndShowGUI(); } public void createAndShowGUI(){ WindowComponents.vertSplitPane = new JSplitPane(…
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
As per your post I did't find any ambiguity in your code. I have added JMenuBar and ContentView and some components into ContentView - There is no problem. I am not sure about JEmailMenuBar class. If it is JMenuBar then use setJMenuBar method of JFrame.
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
huh. I tried it without the JEmailMenuBar (It has a JMenuBar and a JToolbar in it arranged with a GridBagLayout) and it still doesn't work for me.... Are there any methods that I'm forgetting to call, or something like that?
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
Use setJMenuBar method: It has a seperate layer. [CODE=Java] setJMenuBar(menuBar); [/CODE]
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
Ok, I changed my JEmailMenuBar to extend the JMenuBar class, ad added it through the setJMenuBar() method, but it didn't help the contentViever's sizing problems....
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
What is the current size of contentViever? Size of contentViever will be grows or shrink with frame.
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
contentViewer's size is the size of the Frame. however. the JSplitFrame has a size of (0,0)
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by kvprajapati
If you want to change the size of any control use setPreferredSize() method.
Re: JComponent Placement
Programming
Software Development
14 Years Ago
by llemes4011
YAY! I got it, Thanks so much for your help =D It ended up that It was the placement of some static variables. I was trying it access them from another package and I think some how it was throwing it off somehow... the whole static thing is still kind of new to me O.o but very useful.
Re: When to extend a JComponent?
Programming
Software Development
14 Years Ago
by HazardTW
… } } return false; } @Override public boolean canImport(
JComponent
c, DataFlavor[] flavors) { if (hasLocalArrayListFlavor(flavors)) {… return null; } @Override public int getSourceActions(
JComponent
c) { return COPY_OR_MOVE; } public class …
Re: When to extend a JComponent?
Programming
Software Development
14 Years Ago
by HazardTW
…. This method was the culprit: [CODE]@Override protected Transferable createTransferable(
JComponent
c) { if (c instanceof JList) { source = (JList) c;…] I changed it to this: [CODE]@Override protected Transferable createTransferable(
JComponent
c) { if (c instanceof JList) { source = (JList) c;…
Re: How to add Array of JLabels to JComponent
Programming
Software Development
12 Years Ago
by soham.m17
Yes. I've set null layout for "this"
JComponent
.
Re: How to add Array of JLabels to JComponent
Programming
Software Development
12 Years Ago
by soham.m17
I'm giving the required function. the "this"
JComponent
constructor : public Pad_Draw(counts a) { setDoubleBuffered(false); setLayout(null); Pad_counts=…
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC