Expanding width of TLFTextField when parent container resized
Hi
I have spent nearly a day on this now, searching everywhere, but never found anything. This is my desperate attempt to get my problem solved. I hope you can help me.
I have a container (ContentHolder extends Sprite), which holds another container (Content extends Sprite) which has a TLFTextfield in it.
Now when I resize the ContentHolder, its children get resized too. I have overridden set width and set height in the Content class, because I need the Content to resize differently than just scale. I want the TLFTextfield width to adjust to ContentHolder width, while maintaining font size. So ideally the TLFTextfield would set different line breaks, according to the width of ContentHolder.
I really have no idea how this can be achieved. One solution may be to create a new TLFTextfield instance with the updated height and width values, but that could look messy when drag-resizing the ContentHolder..
Thank you very much in advance, much appreciated.
-Neeru
You want "TLFTextfield width to adjust to ContentHolder width"; something like:
function resizeContent():void
yourTLFTextfield.width = ContentHolder.width;
...but for some reason, the above method(or something to likes of it that you're using) isn't working for you?
Post a snipet of your code so we can have a look-see.
~chipleh
Similar Messages
-
Hi All ,
I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox
When you execute the application ,
Click the link button
The Popup window opens up showing the title window with the close button
Click the close button of the title window
The Title window is removed and the iframe and the text area are not visible
Do this a couple of times
You can notice that the iframe is still visible even when the title window is closed
Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible.
Main Application file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
width="100%" height="100%" creationPolicy="all"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" creationComplete="init()"
xmlns:containers="containers.*">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import containers.PopUpBrowser;
public function doRequest():void
var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;
PopUpManager.addPopUp(requestPopup,this);
requestPopup.x = 220;
requestPopup.y = 50;
]]>
</mx:Script>
<mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />
<mx:Spacer height="100"/>
<mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>
</mx:Application>
PopUpBrowser.mxml Component
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
xmlns:mx="http://www.adobe.com/2006/mxml"
close="removeMe()"
showCloseButton="true"
styleName="myTitleWindowStyle"
width="850" height="500"
title="Klout User Profile"
paddingTop="1" paddingBottom="1"
paddingLeft="1" paddingRight="1"
xmlns:generic="com.serendio.voom.components.generic.*"
xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
horizontalScrollPolicy="off"
verticalScrollPolicy="off" >
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public function removeMe():void
PopUpManager.removePopUp(this);
]]>
</mx:Script>
<mx:HBox width="100%" height="100%">
<flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
<mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
fontSize="14" width="50%" height="80%"/>
</mx:HBox>
</mx:TitleWindow>
Thanks,
AjanthaHey,
This is working fine for me with the current 4.5 Flex, Firefox 3.6.12, IE8. On what browser you are getting this error.
Thanks,
Jayagopal. -
How can i centre two side by side divs vertically so they both are in the centre of there parent /containing div? One of the divs is larger than the other so i would want the smaller one to centre inside a parent div like so:
Grey= parent/container (Width of both orange and red div)
Orange= Div 1
Red= Smaller div- centralised (hopefully)If you wanted to go completely "Not for IE8 or lower" and use some of the often overlooked viewport units, it could be very responsive to browser resizing...
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title> VW, it's not just a car for Mac users...</title>
<style>
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
box-sizing:border-box;
#gray {
background-color:gray;
width:80vw;
margin:0 auto;
height:40vw;
font-size:2vw;
#red {
width:50%;
height:50%;
background-color:red;
margin-top:12.5%;
float:left;
#orange {
background-color:orange;
width:50%;
height:100%;
float:left;
</style>
<!--[if lt IE 9]>
<link href="IE-only.css" rel="stylesheet" type="text/css">
<![endif]-->
</head>
<body>
<div id="gray">
<div id="orange"></div>
<div id="red"></div>
</div>
</body>
</html> -
Get parent container size in renderer?
Hi,
I'm trying to add a variable number of same-sized Canvas
squares to the HorizontalList below:
<mx:HBox width="100%" height="50%" >
<mx:HorizontalList height="100%" width="60%"
dataProvider="{myData}"
itemRenderer="renderers.Topic" >
</mx:HorizontalList>
<mx:Canvas height="100%" width="40%" >
</mx:Canvas>
</mx:HBox>
I want the squares to be proportional such that as the app is
resized, the squares also grow or shrink in size. My item renderer
gets the size of the parent HorizontalList (via
BaseListData.owner.width) in order to calculate the dimensions of
each canvas square; as the app is resized, the size of the parent
changes and my square's dimensions are recalculated. However, it
seems that the size of the parent container isn't know until I
render some content but I can't render content until I know the
amount of real estate available in the parent. I missing something
basic here, right?
Thanks, GarryTurn it around. Instead of having the item renderer calculate
its width based on it's parent's width, have the HorizontalList set
the size of its children in updateDisplayList(). -
Float clearing for parent container - DW doesn't display
When I use one of the methods of float clearing for a parent container that has other floated elements inside of it, it seems to work fine in FF and IE. But it never shows up properly in DW design view. Instead, it just continues to show the parent container as collapsed.
Is there some setting in DW that I can change to make it display properly? It's difficult to really know what's going on when it displays like this.
Thanks...
-JesseJesseLY wrote:
Thanks, Osgood. Here's a link to a test page.
http://www.jesseyoung.com/tests/float_test/
It displays fine in FF and IE, but shows the outer container as collapsed in DW design view.
-Jesse
Hi Jesse
Change overflow: auto; to overflow: hidden; on the 'wrapper' css as below. This method will only work in DW CS4 design view.
If you have a previous version of DW then you'll need to use the <br style="clear: both;"> method in the code if you want to see the correct rendering in Design view (see below)
#wrapper {
border: 5px solid purple;
padding: 10px;
overflow: hidden;
width: 700px;
background-color: white;
Insert the <br> after the last floated element (as below)
</div><!-- end floatLeft -->
<br style="clear: both;" />
</div><!--end wrapper -->
Incidentally you appear to have an 'unpaired' </div> tag at the end of the code . -
Datagrid Scrolling Problem.. Does not fit into Parent Container..
Hi All,
I have a module and module contains only one datagrid. I am adding this module to tab navigator dynamically in the next index. I am using Text as Item renderer in the datagrid and the row height will change depending upon the data diplyed on the Text. When the data populate in datagrid the datagrid going beyond the containers layout. i.e height is not fit into parent container. I am using Canvas as parent container .. Please find the below attached pictures and you will get to know what is my problem?
Please help me to get out from this issue.. It is urgent..Thanks for quick reply
Here I am adding this module to canvas and the canvas is also dynamic . As you said "customize the measure() method in Text control and return the correct measuredHeight based on the explicitWidth." what is the relation between Text control height and datagrid? Datagird should take it's parent container width and heights. I am newbie to this Flex.. can you please explain it briefly. And if you have any Other way to do this please tell me .. it is very helpful to me.. Can you please post cusomized measure method if possible. please -
Component is visible only when frame is resize why?
hai,
In My application the components are visible only when the JFrame is resize...... why is it so?
The problem is in login screen..
that is the frame is displayed in middle the default layer for this borderlayout.... the panel here consists of gridbaglayout
whats the problem? the size are all i have checked no problem
Please help me out
ShanthyProbably because you've added the components to the GUI after the GUI is visible.
If this is the case then you need to revalidate the parent container.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting. -
One-to-Many: New child not showing up when parent retrieved
I have a one to many relationship. The parent contains a collection of children in a arraylist.
A new child record is added independent of the parent, via a uow.
The parent is retrieved.
The new child doesn't show up.
So the question is Does the parent first have to be retrieved and the child added to the parent. The child is not and should not be privately owned. The child is not dependent. If the parent goes away the child should still exist."This last part" (as you describe it) is necessary. In a nutshell, you manage the object model (including both directions of a bi-directional relationship) and TopLink updates the database accordingly.
This usually isn't a big issue. I.e., if you have a "addB(ClassB b)" method that looks like this, then you don't have to worry about managing the whole relationship all over the place:
public void addB(ClassB b){
bs.add(b);
b.setA(this);
At commit time the cache and database should be updated properly when you add a "b" to an "a".
I have seen cases where the developer actually ended up not mapping the 1-M relationship in the model and had a "virtual" 1-M relationship. They would add a target to the "virtual" 1-M as you describe (just set the owner, i.e., tell the "b" it belongs to a particular "a". Then, they created a QueryKey in the Mapping Workbench in the Class "A" called "bs". Then they could build expressions and queries using "anyOf" through the "bs", even though it wasn't really mapped! I guess the point is that if you don't want to have to maintain that collection in code, and if it's not used in the application, then don't map it! Just create a QueryKey from A to B so that you can build the expressions as if it was there.
- Don -
Cropping when moving and resizing a cropping rectangle
I created a program that crops an image and displays the cropped image but I'm trying to add more functionality
by making it movable and resizable. The rectangle moves and resizes but it only crops an image when user draws the rectangle and not when moved or resized. I know that the X,Y, height and width position of the rectangle would need to be updated but I'm not
sure how I can accomplish this being new to WPF. Below is my user control "CropControl and the code behind. Also, I'm implementing my code using MVVM framework.
XAML:
<UserControl x:Class="Klein_Tools_Profile_Pic_Generator.CropControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="clr-namespace:Klein_Tools_Profile_Pic_Generator"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<ControlTemplate x:Key="MoveThumbTemplate" TargetType="{x:Type s:MoveThumb}">
<Rectangle Fill="Transparent"/>
</ControlTemplate>
<!-- ResizeDecorator Template -->
<ControlTemplate x:Key="ResizeDecoratorTemplate" TargetType="{x:Type Control}">
<Grid>
<s:ResizeThumb Width="3" Height="7" Cursor="SizeNS" Margin="0 -4 0 0"
VerticalAlignment="Top"/>
<s:ResizeThumb Width="3" Height="7" Cursor="SizeWE" Margin="-4 0 0 0"
VerticalAlignment="Stretch" HorizontalAlignment="Left"/>
<s:ResizeThumb Width="3" Height="7" Cursor="SizeWE" Margin="0 0 -4 0"
VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<s:ResizeThumb Width="3" Height="7" Cursor="SizeNS" Margin="0 0 0 -4"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/>
<s:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE"
VerticalAlignment="Top" HorizontalAlignment="Left"/>
<s:ResizeThumb Width="7" Height="7" Cursor="SizeNESW"
VerticalAlignment="Top" HorizontalAlignment="Right"/>
<s:ResizeThumb Width="7" Height="7" Cursor="SizeNESW"
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
<s:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
</Grid>
</ControlTemplate>
<!-- Designer Item Template-->
<ControlTemplate x:Key="DesignerItemTemplate" TargetType="ContentControl">
<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
<s:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/>
<Control Template="{StaticResource ResizeDecoratorTemplate}"/>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"/>
</Grid>
</ControlTemplate>
</UserControl.Resources>
<Canvas x:Name="BackPanel"
MouseLeftButtonDown="LoadedImage_MouseLeftButtonDown"
MouseMove="LoadedImage_MouseMove"
MouseLeftButtonUp="LoadedImage_MouseLeftButtonUp"
Background="Transparent">
<ContentControl x:Name="contControl" Visibility="Collapsed"
Template="{StaticResource DesignerItemTemplate}">
<Rectangle x:Name="selectionRectangle" Fill="#220000FF"
IsHitTestVisible="False"/>
</ContentControl>
</Canvas>
</UserControl>
CODE BEHIND:
namespace Klein_Tools_Profile_Pic_Generator
/// <summary>
/// Interaction logic for CropControl.xaml
/// </summary>
public partial class CropControl : UserControl
private bool isDragging = false;
private Point anchorPoint = new Point();
private bool moveRect;
TranslateTransform trans = null;
Point originalMousePosition;
public CropControl()
InitializeComponent();
//Register the Dependency Property
public static readonly DependencyProperty SelectionProperty =
DependencyProperty.Register("Selection", typeof(Rect), typeof(CropControl), new PropertyMetadata(default(Rect)));
public Rect Selection
get { return (Rect)GetValue(SelectionProperty); }
set { SetValue(SelectionProperty, value); }
// this is used, to react on changes from ViewModel. If you assign a
// new Rect in your ViewModel you will have to redraw your Rect here
private static void OnSelectionChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)
Rect newRect = (Rect)e.NewValue;
Rectangle selectionRectangle = d as Rectangle;
if (selectionRectangle != null)
return;
selectionRectangle.SetValue(Canvas.LeftProperty, newRect.X);
selectionRectangle.SetValue(Canvas.TopProperty, newRect.Y);
selectionRectangle.Width = newRect.Width;
selectionRectangle.Height = newRect.Height;
private void LoadedImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
if (isDragging == false)
anchorPoint.X = e.GetPosition(BackPanel).X;
anchorPoint.Y = e.GetPosition(BackPanel).Y;
Canvas.SetZIndex(selectionRectangle, 999);
isDragging = true;
BackPanel.Cursor = Cursors.Cross;
private void LoadedImage_MouseMove(object sender, MouseEventArgs e)
if (isDragging)
double x = e.GetPosition(BackPanel).X;
double y = e.GetPosition(BackPanel).Y;
contControl.SetValue(Canvas.LeftProperty, Math.Min(x, anchorPoint.X));
contControl.SetValue(Canvas.TopProperty, Math.Min(y, anchorPoint.Y));
contControl.Width = Math.Abs(x - anchorPoint.X);
contControl.Height = Math.Abs(y - anchorPoint.Y);
if (contControl.Visibility != Visibility.Visible)
contControl.Visibility = Visibility.Visible;
private void Image_MouseMove(object sender, MouseEventArgs e)
if (moveRect)
trans = selectionRectangle.RenderTransform as TranslateTransform;
if (trans == null)
selectionRectangle.RenderTransformOrigin = new Point(0, 0);
trans = new TranslateTransform();
selectionRectangle.RenderTransform = trans;
trans.Y = -(originalMousePosition.Y - e.GetPosition(BackPanel).Y);
trans.X = -(originalMousePosition.X - e.GetPosition(BackPanel).X);
e.Handled = false;
private void LoadedImage_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
if (isDragging)
isDragging = false;
if (contControl.Width > 0)
//Crop.IsEnabled = true;
//Cut.IsEnabled = true;
BackPanel.Cursor = Cursors.Arrow;
contControl.GetValue(Canvas.LeftProperty);
// Set the Selection to the new rect, when the mouse button has been released
Selection = new Rect(
(double)contControl.GetValue(Canvas.LeftProperty),
(double)contControl.GetValue(Canvas.TopProperty),
contControl.Width,
contControl.Height);Hello HotSawz,
The ResizeThumb and MoveThumb is not in your code so I cannot compile. Anyway, it is not the problem.
Anyway, can you clarify more details about "it only crops an image when user draws the rectangle and not when moved or resized", it is already normal behavoir for you to draw a rectangle and then move it. What kind of action do you want? Do you
mean some controls like this:
http://www.codeproject.com/Articles/23158/A-Photoshop-like-Cropping-Adorner-for-WPF
Best regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
CFIMAGE gives "attempt to read data outside of exif segment" error when trying to resize jpg
When trying to resize a jpg using cfimage I receive the following error "attempt to read data outside of exif segment". Any ideas on what causes this or how to fix it? This only happens on certain images. Sample image it happens with attached, this photo is subject to copyright restrictions and should be treated appropriately. Thanks for any help.
Resize Code attached.
<!--- Set some defaults used by each image type, unless you override them --->
<cfparam name="jpgQuality" default=".8" />
<cfparam name="defaultInterpolation" default="bicubic" />
<cfparam name="defaultBackground" default="black" />
<!--- Set values for each image type --->
<cfparam name="thumbMaxWidth" default="" /> <!--- leave blank to allow any width (forced to size by height) --->
<cfparam name="thumbMaxHeight" default="60" /> <!--- leave blank to allow any height (forced to size by width, above) --->
<cfparam name="thumbQuality" default="1" /> <!--- number from 0 - 1, 1 being the best --->
<cfparam name="thumbFixedSize" default="false" /> <!--- you MUST set both MaxWidth & MaxHeight to use FixedSize --->
<cfparam name="thumbBackground" default="#defaultBackground#" /> <!--- color of background if fixed size is used --->
<cfparam name="thumbInterpolation" default="#defaultInterpolation#" /> <!--- Interpolation method used for resizing (HUGE performance hit depending on what is used) --->
<cfparam name="normalMaxWidth" default="476" />
<cfparam name="normalMaxHeight" default="324" />
<cfparam name="normalQuality" default="#jpgQuality#" />
<cfparam name="normalFixedSize" default="true" />
<cfparam name="normalBackground" default="#defaultBackground#" />
<cfparam name="normalInterpolation" default="#defaultInterpolation#" />
<cfparam name="zoomMaxWidth" default="670" />
<cfparam name="zoomMaxHeight" default="380" />
<cfparam name="zoomQuality" default="#jpgQuality#" />
<cfparam name="zoomFixedSize" default="true" />
<cfparam name="zoomBackground" default="#defaultBackground#" />
<cfparam name="zoomInterpolation" default="#defaultInterpolation#" />
<!--- Set values for folder paths and the watermark image --->
<cfparam name="originalFolder" default="path to folder for original images" />
<cfparam name="thumbFolder" default="path to folder for thumbnail images" />
<cfparam name="normalFolder" default="path to folder for large images" />
<cfparam name="zoomFolder" default="path to folder for large resized images" />
<cfparam name="watermarkImage" default="" />
<cfparam name="wmXPosition" default="50" /> <!--- value is a number from 0 - 100, 50 = centered --->
<cfparam name="wmYPosition" default="65" />
<cffunction name="genWatermarkImage">
<cfargument name="ImageFile" required="true" />
<cfargument name="MaxWidth" required="true" />
<cfargument name="MaxHeight" required="true" />
<cfargument name="StorePath" required="true" />
<cfargument name="FixedSize" required="true" type="Boolean" />
<cfargument name="Background" required="true" />
<cfargument name="Quality" required="true" />
<cfargument name="Interpolation" required="true" />
<cfargument name="AddWatermark" required="true" type="Boolean" />
<cfif IsImageFile(originalFolder & ImageFile)>
<cfset original = ImageNew(originalFolder & ImageFile) />
<cfset originalHeight = ImageGetHeight(original) />
<cfset originalWidth = ImageGetWidth(original) />
<cfset outfile = StorePath & ImageFile />
<cfset watermark = ImageNew(watermarkImage) />
<cfset ImageScaleToFit(original,MaxWidth,MaxHeight,Interpolation) />
<cfset new_w = ImageGetWidth(original) />
<cfset new_h = ImageGetHeight(original) />
<cfif FixedSize>
<cfset normal = ImageNew("",MaxWidth,MaxHeight,"rgb",Background) />
<cfset ImagePaste(normal,original,int((MaxWidth-new_w)/2),int((MaxHeight-new_h)/2)) />
<cfif AddWatermark>
<cfset ImagePaste(normal,watermark,( int(ImageGetWidth(normal)) - int(ImageGetWidth(watermark)) -3),( int(ImageGetHeight(normal)) - int(ImageGetHeight(watermark)) -3) )/>
</cfif>
<cfset ImageWrite(normal,outfile,Quality) />
<cfelse>
<cfif AddWatermark>
<cfset ImagePaste(original,watermark,( int(ImageGetWidth(normal)) - int(ImageGetWidth(watermark)) -3), (int(ImageGetHeight(normal)) - int(ImageGetHeight(watermark)) -3) )/>
</cfif>
<cfset ImageWrite(original,outfile,Quality) />
</cfif>
<cfelse>
<cfreturn "Image file not an image!" />
</cfif>
</cffunction>
<cfset zoomError = genWatermarkImage(Filename,zoomMaxWidth,zoomMaxHeight,zoomFolder,zoomFixedSize,zoomBackground,zoomQuality,zoomInterp olation,dowatermark) />Hmm, that was my best shot.
1) Do you have all of the latest updates applied?
2) Did you try all of the work-arounds listed in the comments. Granted some of them are definite hacks
3) Just to cover all the bases, do you get the same result with both ImageResize() and ImageScaleToFit()?
If all else fails, you could always go the java route and try some java code to do the resize. Obviously not the ideal, but it is worth a shot. IIRC there is a thread around here somewhere with the cf/java code. But that was from before the switch in forums and I will be darned if I can find it right now!
Update: I will play around the sample image you posted tomorrow. Just to see if I can come up with anything. -
Revision: 11789
Revision: 11789
Author: [email protected]
Date: 2009-11-13 11:38:40 -0800 (Fri, 13 Nov 2009)
Log Message:
When a UIMovieClip resizes, it does so through scaling. Before UIMC was keeping track of this on it's own. Now that AdvancedLayoutFeatures support this through scaleX/scaleY, UIMC can now rely on this behavior. This also helps fix some Effects bugs which rely on this to figure out the difference in transformations that get applied and contribute to the "width" and "height" properties and ones that don't.
QE notes: Can re-include the 3 FCK tests and regen the bitmaps
Doc notes: -
Bugs: SDK-23754, SDK-23779
Reviewer: Evtim
Tests run: checkintest, mustella FCK
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-23754
http://bugs.adobe.com/jira/browse/SDK-23779
Modified Paths:
flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/ContainerMovieClip.as
flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/FlexContentHolder.as
flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as
flex/sdk/trunk/frameworks/projects/utilities/src/MyFlexContentHolder.asok, I just managed to find this bug report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4909116
Apparently it's "not a bug, it's a feature" :-S -
Question about hearing when a window resizes.
I have a class that extends JLabel on the LayeredPane of a JFrame and when I resize the JFrame to the point that I no longer see the JLabel, the label does not redraw. I am currently overriding the paintComponent of JLabel but when the resize puts my Label outside the window, it doesn't show up. Any help would be appreciated.
Are you familiar with the premise of Occam's Razor?
Why is it important that the lable be drawn when it can't be seen by the user anyway?
The simple solution would be to set the minimum size of the container such that it's always visible, that way it always repaints when the container repaints.
Something you might try if you really want to, is to put all of the screen elements into a scroll pane that way, when the frame resizes to smaller than the display area, you'll have scroll bars so the user can move the view area (snip). I don't know off hand whether the paint of the label would be called if the label wasn't currently in view though my first thought is probably that it wouldn't be called until it entered the view area.
It would take some experimentation to find out.
Good luck
-ps31 -
Auto creation of child requests when parent request has more than one group
Hi,
I have created a request dataset which has a child form for AD Group. While raising a request, if I add more than one group, how to process the approval flow. Because I will be having different different approvers for different different groups. Is there any way to create child requests automatically when we submit a request with more than one group? I am using OIM 11.1.1.5.0.
I know in OIM 11g, whenever user raises request for more than one beneficiary/target-resource then OIM breaks that request into Child Requests. But this is not happening when I add more than one group in the same resource. Do I need to write my own code for DataValidator to split parent request into child requests upon validating child form? If so, is it going to impact the existing feature which is creating child request when parent has more than one user/resource.
Please let me know.No not possible OOTB in current version. Check {thread:id=2318652} for more information.
-Bikash -
How to resize the components in a JFrame when the JFrame Resizes?
Hi all,
i have some problems with my app. I have set the JFrame resizable and that works fine for the JFrame but not for the components in the JFrame.
So my question is how can i set the components in a JFrame to resize automatically when the JFrame resizes?
Here are the important things from my code,...if you need more, just let me know, its my first post in a forum .
Its a JFrame with a JTabbedPane and on the Tabs are Panels with buttons and Tables.
Thank you in advance!
public class MainMonitor extends JFrame {
public MainMonitor() {
super();
initialize();
setVisible(true);
private void initialize() {
this.setSize(1145, 785);
this.setIconImage(Toolkit.getDefaultToolkit().getImage("Images/c.gif"));
this.setContentPane(getJContentPane());
this.setTitle("Company Manager");
this.setResizable(true);
this.setLocationRelativeTo(null);
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.setOpaque(true);
jContentPane.add(getJTabbedPane(), null);
jContentPane.add(getJPanel11(), null);
return jContentPane;
private JTabbedPane getJTabbedPane() {
if (jTabbedPane == null) {
jTabbedPane = new JTabbedPane();
jTabbedPane.setLocation(new Point(6, 69));
jTabbedPane.setSize(new Dimension(1120, 684));
jTabbedPane.addTab("P", null, getJPanel(), null);
jTabbedPane.addTab("K", null, getJPanel1(), null);
jTabbedPane.addTab("B", null, getJPanel2(), null);
return jTabbedPane;
Giasaste wrote:
Thanks a lot, i didnt knew that the Layout Manager is a must.It's not a must, but it is the way to allow your app to be resized nicely and makes it much easier to maintain and enhance your program. Imagine creating a complex gui then later decide that you want another radiobutton and to remove a jlabel / jtextfield pair. with layout managers a chore becomes easy. -
I have a panel (which contains buttons) which is added in another panel and this another panel is also added in another tab container and the tab is in a JFrame. Now, in panel which contains buttons, there is a button- CLOSE. Now,how can I dispose the parent (may be grand parent) container- JFrame from that class of panel (button panel).
HA HA...........but if the parents dont have the capability to save themselves and give the child a means to kill them..what to do? I just want to know HOW CAN A CHILD DO THAT so that I can take some measures for saving the parents....lol..
Maybe you are looking for
-
IPhoto Library folder "Missing" in 08 version???
So, I'm using the new "Sharing" feature in Leopard's Finder to share files between my iMac and my MacBook over my wireless network. This seems to be working fine for my documents and even my iTunes music. My only problem is I can't locate the iPhoto
-
Inserting Images into Dreamweaver through Div Tag
Hi im quite new to Dreamweaver and i've got CS3...I've just designed and sliced up a website in Photoshop and have started to compile it together in Dreamweaver using HTML and CSS. I've just added a Div tag and added images into the page and i've got
-
Configure "best practise baseline" manually
Dear experts! I'm studying SAP ERP as a student. I am interesting in SD. I have read the certification material TSCM and SCM. Now I am waiting for your advice whether I need to configure "best practise baseline" manually. We see, it will take a lot o
-
TOPLINK-60 when weaving activated
Hello, environment: TL-essentials, jdk 1.5.08, windows xp SP2 i get the following error: (seems to be a problem with the valueholder....) Exception [TOPLINK-60] (Oracle TopLink Essentials - 2006.7 (Build 060720)): oracle.toplink.essentials.exceptions
-
Hello, While searching for a WiFi router maybe a month ago, I was surprised at how hard it was to find the range of a wireless router. Furthermore, it would be helpful if the datasheets / pdf's would contain tables that compare speed and signal stren