components

Is it possible to have “movable”/“draggable” components like JButtons, JTextFields in a JFrame?

妖精的绣舞 提交于 2019-12-05 09:14:26
Basically I plan to place some buttons, textfields, labels, etc. on a JFrame and I would like to make it possible that a user can move the different components around on that JFrame with the mouse. I have seen various ways with MouseListeners, subclassed JComponent code, DropSource/DropTarget implementations and so on, but I'm unsure which is the "recommended" way (I don't need to support "drag and drop" between different Frames/Applications which is what most examples seem to do). The Component Mover can do this for you. Use the GlassPane: http://download.oracle.com/javase/tutorial/uiswing

JSF component binding - some confusion

╄→尐↘猪︶ㄣ 提交于 2019-12-05 07:17:38
From web pages like this one, http://www.jsftutorials.net/components/step5.html I understand that the binding attribute in JSF tag/view component is to bind the view component to a Java instance of the UI component in the backing bean. E.g., that's what is done in the following code: <h:inputText value="#{ myBean.someProperty}" binding="#{ myBean.somePropertyInputText}"/> But sometimes I see code like this : <h:commandButton id="t1" binding="#{foo}" value="Hello, World!" onclick="alert('I am #{id:cid(foo)}'); return false;" /> where id:cid is a taglib function which is defined as follow:

How to get a BufferedImage from a Component in java?

帅比萌擦擦* 提交于 2019-12-05 06:58:46
I know how to get a BufferedImage from JComponent, but how to get a BufferedImage from a Component in java ? The emphasis here is an object of the "Component" type rather than JComponent. I tried the following method, but it return an all black image, what's wrong with it ? public static BufferedImage Get_Component_Image(Component myComponent,Rectangle region) throws IOException { BufferedImage img = new BufferedImage(myComponent.getWidth(), myComponent.getHeight(), BufferedImage.TYPE_INT_RGB); Graphics g = img.getGraphics(); myComponent.paint(g); g.dispose(); return img; } Component has a

Error: Adjacent JSX elements must be wrapped in an enclosing tag

别等时光非礼了梦想. 提交于 2019-12-05 06:09:32
I am trying to print props of a react component but getting an error. Please help: Snippet: <!-- DOCTYPE HTML --> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js"></script> <script src="http://fb. me/JSXTransformer-0.12.1.js"></script> <!-- gap above is intended as else stackOverflow not allowing to post --> </head> <body> <div id="div1"></div> <script type="text/jsx"> //A component var George = React.createClass({ render: function(){ return ( <div> Hello

ANGULAR 4 Base64 Upload Component

我的未来我决定 提交于 2019-12-05 05:55:47
I am new to Angular. I am using Angular 4. Where there is a requirement to send the base64 Image as one of the model member to the web api. Is there a Angular component or directive for the that would bind the base64 to the said model? Appreciate and Thank you for the help. You can upload image and store it as base64 encoded. In your template add this <div class="image-upload"> <img [src]="imageSrc" style="max-width:300px;max-height:300px"/> <input name="imageUrl" type="file" accept="image/*" (change)="handleInputChange($event)" /> </div> And this will handle your upload mechanism from

Good Library for Creating E-mail Templates with Merge Ability

感情迁移 提交于 2019-12-05 05:41:35
问题 I'm looking for a really good library/component/framework for creating e-mail templates for my web application. We send out a number of e-mails on a regular basis: Activate Your Account Welcome Thanks for Your Order Etc. I'd like to give the non-technical administrators of my web app a way to: See the current e-mail template (HTML, WYSIWYG) Make some minor modifications to copy, colors, etc. Preview, Test, Save, and "deploy" a new version of the e-mail template. The tool needs to support

How to use a variable from a component in another in Angular2

不羁的心 提交于 2019-12-05 05:35:29
I was wondering if it is possible to use variable values from one component into another one without having to use the template of the first one, just need the value of the variable nothing else. Is it possible? Yes possible, you can use the @Input() method or use write get method like below export class Demo { const sum = 10; get SumValue() { return this.sum; } } import-->Demo export class Demo2 { private sum: number; this.sum = Demo.SumValue(); } Muhammad Awais Go to your app.module.ts and make the provider of that component you want to inherit with other classes: Then go to the class you

JSF ui:fragment rendered performance

感情迁移 提交于 2019-12-05 05:00:48
问题 I have a set of jsf components that are statically generated from a set of excel files (they are updated by business people). Each generated file represents a business object that has slightly different data, and all of them belong to a same class. In order to render this dynamically, the only solution I found was to set up a bunch of ui:fragment and dispatch to the right component at runtime: <!-- IMPLEMENTATION --> <composite:implementation> <ui:fragment rendered="#{cc.attrs.type eq

Angular: Pass Component to a Component

北慕城南 提交于 2019-12-05 04:43:57
I have this small gridComponent: @Component({ selector: 'moving-grid', templateUrl: './grid.component.html', styleUrls: ['./grid.component.css'] }) export class GridComponent { @Input('widgets') extComponents: Array<Component>; } And a second testComponent @Component({ selector: 'test', template: ` <div #content>I say hello<li>i</li><li>u</li><button (click)="test()">click me</button> world</div> ` }) export class TestComponent { @ViewChild('content') content: HTMLElement; getContent() { return this.content; } test() { console.log("test"); } } Now I'm trying to pass multiple instances of

Reactjs - passing state value from one component to another

折月煮酒 提交于 2019-12-05 03:25:10
I have two components SideNav and Dashboard (two are in different js files). SideNav will have selectbox as filters. I have to pass an array from Dashboard component to Sidebar component. This array has to given as values for select box (which is inside sidenav component). P.S. What will be the case if I have two different component classes defined in two different JS files. e.g. HomeComponent/Home.js -> Parent component Dashboard/Dashboard.js -> Child component I am making API call on "Home.js" file and getting some data. I want to pass these data to "Dashboard.js" file (component) All the