Create custom swing control
Hi,
I'd like to create my very own swing component. It isn't just a modification of an existing one but rather a group of existing components (JButton, JProgressbar, JToggleButton) that interact. Is there a way to do this with some kind of visual editor like you can crate a custom control in the Visual Studio .Net?
Kind regards,
Stijn
arrrghh did you say "Visual Studio .Net"
aaargh did you say "visual editor"
just kidding...
You can combine different JComponents in a container component...JPanel would be the most suitable I think... So you just create a class myCustomComponent... which extends JPanel... If you want, you could give some parameters through the constructor..
... and there you go... new myCustomComponent("This could be heading text"); will create your "custom component"...
There are visual editors... (jbuilder has one, lots of IDE's have visual editors these days) But beware of:
- the auto-generated code (lots of overhead)... hope it works...because you dont want to debug this code
- (not all but) most dont use layoutmanagers (the way they should) meaning you are creating "Visual Basic" applications (every component has fixed size, no matter what resolution, framesize, etc)
- most important...you dont learn how to work with swing !
V
Similar Messages
-
How to create custom Data Control for Iterator?
Hi,
I have seen somewhere that is possible to customize set of data controls for all iterators in Data Controll Palette e.g. by adding custom data control (I remember JDev uses Velocity to display data controls). Is there any documentation or tutorial how to do it. Meybe any Oracle ACE will write some steps on his blog.
KubaI'm looking for any documentation or better some examples to customize files:
jdev/system/oracle.adfm.dt.faces.10.1.3.41.57/jsp_databinding_templates.xml
jdev/system/oracle.adfm.dt.faces.10.1.3.41.57/faces_creator_configuration.xml
This customization may be very useful while developing appliations
Kuba -
Is there a way to create customer smart controls?
I use Mainstage to play worship music in a few different church venues and love the flexibility that Mainstage brings. I'm using an external instrument, Omnisphere on my Akai MPK88. I have each channel mapped to sliders on my keyboard, which is great for Omnisphere, however, if I want to switch insturments, for example to the Hammond B3, I would like be able to use the new smart controls feature and be able to see the controls for this instrument. Is there a way to keep my sliders on screen for Omnisphere, but have them change when I am using a native patch? Right now, the controls just get greyed out and go dead. Thanks!
You can pick any Smartcontrol for any patch, but you can not create your own Smartcontrol from scratch.
-
Create Custom list form and validate fields using sharepoint designer 2010
Hi All,
I have a requirement to create a custom job application form which will be filled and submitted by anonymous users. I have a an option to create custom user control web part but I wanted to
create it using custom list form using SharePoint designer. My requirement is below
Date of birth (user age should be above 22yrs )
Email Validation
Phone validation
Resume attachment (should attach only word documents or PDF)
Qualification (If other is selected then show textbox else hide)
Can above validations be done using SharePoint designer (JavaScript or validation controls)? Or do I have to create custom control web part?
MercuryManHello,
I think jquery/javascript can be used to put validations on those fields. Fortunately some of validation can be done via sharepoint itself like: email, phone, age. For Attachment and Qualification fields use jquery/JS.
See below link for column validations:
http://thechriskent.com/2012/08/15/validate-phone-number-columns-in-sharepoint/
http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/
See this for attachment:
http://stackoverflow.com/questions/4234589/validation-of-file-extension-before-uploading-file
For qualification:
http://sharepoint.stackexchange.com/questions/88064/hide-show-field-on-list-form-based-on-value-from-another-field
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help -
How to create custom class for Swing compnents
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.*;
public class SampleJFrame extends JFrame {
public static void main(String[] args) {
SampleJFrame frame = new SampleJFrame();
JPanel panel = new JPanel();
panel.setLayout(null);
getLabel label;
Color color, color1;
color = new Color( 120 , 120 , 160 );
color1 = new Color( 135 , 38 , 87);
label = new getLabel( "Hiiiiii", 150, 700, 800, 50, color1, "Serif", Font.BOLD, 28 );
panel.add(label);
frame.add(panel);
frame.setSize(700, 770);
frame.setVisible(true);
frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;
public class getLabel extends JLabel {
* This method create and return the JLabel with necessary parameter
* @param labelName
* @param x coordinate
* @param y coordinate
* @param width
* @param height
* @param foreground color
* @param fontName
* @param fontStyle
* @param fontSize
* @return JLabel
public getLabel( String labelName, int x, int y, int width, int height, Color foreGround,
String fontName, int fontStyle, int fontSize ){
JLabel label = new JLabel(labelName);
label.setBounds( x, y, width, height);
label.setForeground(foreGround);
label.setFont(new Font(fontName, fontStyle, fontSize));
} // End of getLabel block
}I want to use customs JLabel class where I can add necessay element to JLabel comonent
But in above case the getLabel class compiles but when I am add label using getLabel class
to my JFrame class it doesnt shows anything.
I dont get what is the error please help
Edited by: harshal_2010 on Apr 29, 2010 6:43 AM
Edited by: harshal_2010 on Apr 29, 2010 7:01 AMI don't understand, Why you try to create new Label in getLabel constructor?
You get label class already extended from JLabel and don't necessary to create new JLabel.
public getLabel( String labelName, int x, int y, int width, int height, Color foreGround,
String fontName, int fontStyle, int fontSize ){
super(labelName);
this.setBounds( x, y, width, height);
this.setForeground(foreGround);
this.setFont(new Font(fontName, fontStyle, fontSize));
}I think, you need to create ControlsFactory and use it for creating custom controls. It's best solution for you. -
Creating Custom Control on screen dynamically
Hi All,
Is it possible to create custom controls dynamically through ABAP code.
If not, can we change the size of custom control at run time through ABAP code.
Thanks
Satya PriyaHi,
Please ellaborate your Query...
if ur taking abt Custom Control in Reporting , Module Pool than it is possible using Events.
Affable
Arbind -
SAPUI5-How to create custom Split Page control
I want to create a custom split -like page control using sap.m library instead of Splitter.This page should contain two areas left and right
content with different width.How to create this type of page as a custom control?
Please help me with this.Hi,
I think There is no need to create Custom Page for the labels.
To create labels in SAPSCRIPT, you will have to define multiple MAIN WINDOWS in the Page Window.. try the following steps..
Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
1. Create a page window and assign it to a page.
2. Choose Edit --> Main windows.
A dialog box appears.
3. Enter values in the fields Area width and Area height in accordance with the input guidelines for main windows.
4. Enter values in the fields Spacing and Number in the Horizontal group if you want to use multiple columns. You can ignore the fields in the Vertical group.
5. Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the Horizontal and Vertical groups.
Also Check these links.
how to create labels in sap script?
labels in script
Labels in Scripts
Regards
Shiva Kumar -
Is it possible to create a custom filter control in SSRS 2005?
Hello!
I need to make a custom filter control for my reports which will provide some options for date parameter:
- year and month selection
- Some RadioButtons: "Yesterday", "Today", "Tommorow", "Last week", "Next week"
- Date range
Please, give any suggestion which can help to solve this task.Vsevolod,
Unfortunately there is no built-in support for this customization in SSRS so far. You have to code to implement this feature in your custom application. For example, use a ReportViewer control in an ASP.NET application or a Win Form application.
Anyway I think that you promote a good suggestion to improve Microsoft product's feature. Could you please give your feedback to our product team here?
https://connect.microsoft.com/sql
Thank you.
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Issue in custom delegate control
hi
am creating a custom delegate control with controlid ="AdditionalPageHead" . i deployed and activated as a site collection feature.
but i am not sure how to see the activated control/ how to see this control in action.
below is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Diagnostics;
namespace OPUserDispName
public class EcmaScriptDelegateControl :WebControl
protected override void OnLoad(EventArgs e)
base.OnLoad(e);
string helloAlert = "alert('Hello, world!');";
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "popup", helloAlert, true);
// if(!HttpContext.Current.User.Identity.IsAuthenticated)
// return;
// SPUser user = //SPContext.Current.Web.EnsureUser("i:0#.f|OPMembership|OPAdmin");
// user.Name = "OPAdmin";
// user.Update();
in my elements.xml file of my module :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control Id="AdditionalPageHead" ControlAssembly="OPUserDispName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=467af93481413beb" ControlClass="OPUserDispName.EcmaScriptDelegateControl"
></Control>
</Elements>
here i wanna see alert when the activated/or page load happened.
may i know, how to see this, in working. as per the current scenario, am unable to see any output even after feature activation.
do i need to do any settings in master page? do i need to perform any changes in web.config.
help is appreciated!This has complete solution.
http://www.codeproject.com/Articles/113704/SharePoint-Master-Page-Customizations-Through
can you try RegisterStartupScript instead
of RegisterClientScriptBlock?
Bala -
How do I reuse a custom java control in another project?
Relatively simple question, but I am having a lot of trouble with this. Documentation
alludes to this being possible and easy, but never says how (and the only tutorials
I can find describe creating a custom java control in the same project where they
are used):
"You can design a custom control for use in one project, or you can design a custom
control for easy reuse in multiple projects." (from WLS docs on Java Controls)
"When the control project builds, all of the controls and associated files are
compiled into a single jar file and pushed onto the classpath of the containing
application for immediate use and testing by other projects in the application.
This jar is self-contained and can be moved to any other application by adding
it to the application’s Library folder. Appropriately marked controls in the Library
it will automatically appear on the user’s palette, ready for incorporation into
an application." (from dev2dev article on controls, P. Hussey)
I have a Workshop application which contains a few projects. One project is a
component project, another is a web project. I created a custom java control in
the control project and built it (JAR appeared in the Libraries folder). Now I
open up the page flow in my web app project, and try to drag the java control
onto my page flow - but I get an eror that the control must reside in the same
project! It does not automatically appear on my palate, so if I go over to the
palate on the right, and try to "add control" I only get a list containing the
BEA controls - no custom controls are listed.
What am I doing wrong? How can I incorporate my custom control into a web project?
I don't want to move the control in the web project, since this contradicts the
concept of a separate shared library. I should be able to build a library of controls
and reuse them in our web projects right?
-BobPlease disregard... I got it to work. For some reason I had to close Workshop,
restart it, then I reloaded the application, rebuilt the control project, and
now my control appears in the list of controls and can be easliy added to the
palette.
"Bob" <[email protected]> wrote:
>
Relatively simple question, but I am having a lot of trouble with this.
Documentation
alludes to this being possible and easy, but never says how (and the
only tutorials
I can find describe creating a custom java control in the same project
where they
are used):
"You can design a custom control for use in one project, or you can design
a custom
control for easy reuse in multiple projects." (from WLS docs on Java
Controls)
"When the control project builds, all of the controls and associated
files are
compiled into a single jar file and pushed onto the classpath of the
containing
application for immediate use and testing by other projects in the application.
This jar is self-contained and can be moved to any other application
by adding
it to the application’s Library folder. Appropriately marked controls
in the Library
it will automatically appear on the user’s palette, ready for incorporation
into
an application." (from dev2dev article on controls, P. Hussey)
I have a Workshop application which contains a few projects. One project
is a
component project, another is a web project. I created a custom java
control in
the control project and built it (JAR appeared in the Libraries folder).
Now I
open up the page flow in my web app project, and try to drag the java
control
onto my page flow - but I get an eror that the control must reside in
the same
project! It does not automatically appear on my palate, so if I go over
to the
palate on the right, and try to "add control" I only get a list containing
the
BEA controls - no custom controls are listed.
What am I doing wrong? How can I incorporate my custom control into a
web project?
I don't want to move the control in the web project, since this contradicts
the
concept of a separate shared library. I should be able to build a library
of controls
and reuse them in our web projects right?
-Bob -
Error While Creating Customer Account Site.
Hi ,
I am creating a customer thru API's.
I am succesffuly creating location,party,party site,party site use,customer account.But unable to create customer account site. I am getting the below error:
Unable to process your transaction. The operating unit is either invalid or it cannot be derived. Please verify your Multi-Org profile options.
Could anyone help me to resolve out this issue.Hi,
What is the application release?
Did you set the Application/Multi-org context properly before using this API?
Note: 732671.1 - 'Change PO API' Errors with 'Multi-Org profile options' as Org Context Is Not Set Correctly
Note: 420787.1 - Oracle Applications Multiple Organizations Access Control for Custom Code
Note: 209185.1 - How To Set the Applications Context (FND_GLOBAL.APPS_INITIALIZE)
Regards,
Hussein -
While creating customer master i am getting the Communication error
Hi experts,
while creating customer master i am getting the Communication error with the external tax system (VERTEX_MS0018) please tellme how to solve this issue
Regards,
Anil prasad
Edited by: prasadanil on Sep 16, 2011 12:52 PMhI Prasad,
It seems you are maintaining the address data for a country with jurisdiction code. Different external control systems can behave in different ways.
1. You entered a jurisdiction code that matches the postal code but not the city (possibly due to a typo).
a) Behavior when you use Taxware: There is no message and data can be saved.
b) Behavior when you use Vertex: Due to the incorrect city, no comparison jurisdiction code can be determined and message TAX_TXJCD861 is issued with a text from the vertex system that may be unintelligible.
2. You do not enter a jurisdiction code, but you do enter a postal code and a city that does not match the code (possibly due to a typo).
a) For Taxware: If the jurisdiction code could not be explicitly determined, a selection dialog box containing the relevant tax jurisdiction codes for the postal code appears. You select one. This and the corresponding city are transferred.
b) For Vertex: The TAX_TXJCD861 message is issued (behavior as in 1b). Other terms TAX_TXJCD861, TAX_TXJCD101, TAX_TXJCD107.
For resolving this issue, you can check SAP Note 677850 - Address data: Check/new determination jurisdiction code.
Hope you will resolve the above issue with these inputs.
Let me know if you need any further details.
Ravi. -
Create customer with reference to customer master
Hi,
If the user creates customer master (XD01) with reference to another customer master then system should not copy some of the fields. How can I restrict this in SAP. Is there any Copy control functionality for customer master to customer master?
Regards,
SoumenHello,
As far as i know in Standard SAP system, when we are copying or even creating a Customer
Master Recording in XD01 with reference to a customer, in case of the basic data i.e. General Data, the
datas that are copied are
1. Country.
Under Company Code data, the following are copied,
1. Reconcilation Account.
Under Sales Area Data the following are copied,
1. Currency.
2. Shipping condition.
3. Account assignment group.
4. Taxes.
Regarding your question, you can change the data and there is no concept of copying control here.
Regards,
Sarthak -
Disable Toolbar in custom TextEditor Control
Dear Gurus ,
I made a custom Texteditor control in my own screen. The problem is that i can't disable the toolbat above the control .
Please see my code ....
CREATE OBJECT G_EDITOR_3
EXPORTING
PARENT = G_EDITOR_CONTAINER_3
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
WORDWRAP_POSITION = 70
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
TITEL = G_REPID
TXT2 = SPACE
TXT1 = TEXT-001.
ENDIF.
Thanks a lot ....Hi,
Try this code to disable your custom designed texteditor.
CALL METHOD: editor_s->set_toolbar_mode
EXPORTING toolbar_mode = '0'.
pls don't forget to place your container name inplace of mine,i.e "editor_s".
do rply if it's workable.
Edited by: izullah on Feb 16, 2010 7:24 AM -
Urgent help needed in creating customer ship_to and bill_to site id
Hi,
I am using an api to create customer ship_to and bill_to address, in Oracle OM R12 but the api does not return values. I am including the code so any suggestion will be helpful.
declare
l_num_billing_site_use NUMBER;
l_num_cust_site_id NUMBER;
l_rec_cust_site_use apps.Hz_Cust_Account_Site_V2pub.CUST_SITE_USE_REC_TYPE;
l_rec_customer_profile apps.Hz_Customer_Profile_V2pub.CUSTOMER_PROFILE_REC_TYPE;
l_chr_retcode VARCHAR2(20);
l_chr_errbuf VARCHAR2(200);
l_num_count NUMBER;
begin
-- fnd_global.apps_initialize (1885, 21623, 660); -- user id, --resp_id (OM Super User), appl_id
-- mo_global.init ('AR');
-- mo_global.set_policy_context ('S', 511);
l_rec_cust_site_use.site_use_code := 'BILL_TO';
l_rec_cust_site_use.cust_acct_site_id := 24919;
l_rec_cust_site_use.primary_flag := 'N';
l_rec_cust_site_use.created_by_module := 'CONVERSION'; -- Change
BEGIN
apps.Hz_Cust_Account_Site_V2pub.create_cust_site_use( p_init_msg_list => FND_API.G_FALSE
, p_cust_site_use_rec => l_rec_cust_site_use
, p_customer_profile_rec => NULL --l_rec_customer_profile
, p_create_profile => FND_API.G_FALSE
, p_create_profile_amt => FND_API.G_FALSE
, x_site_use_id => l_num_billing_site_use
, x_return_status => l_chr_retcode
, x_msg_count => l_num_count
, x_msg_data => l_chr_errbuf);
EXCEPTION
WHEN OTHERS THEN
FND_FILE.PUT_LINE(FND_FILE.LOG,' Unexpected error creating customer site for Cust Site Id ' || l_num_cust_site_id || ' due to: ' || SQLERRM);
END;
dbms_output.put_line('cust_site_use:'||l_num_billing_site_use);
end;
Thanks,
Srinivas
Edited by: user2138419 on Feb 14, 2010 4:46 PMIt might be a crossdomain.xml problem.
Please make sure that the server hosting the xml allows the domain where the swf is hosted.
You can start with:
<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>
Maybe you are looking for
-
I am calling a sqlloader script from unix script. I have mentioned in unix script for bad file as BADFILE="/web/local/orderlink/linkload/logs/full_prc_stg_bad.log"and in CTL file I have not mentioned any bad file path. I am calling 30 flat files in t
-
Hello experts, I need you one more time to help me write abap code... In a query, a mandatory variable for multiple values (ZS_ZBILL_TYPE) is populated by the user. I need to check if the value 'ZRE' was selected in this variable. If yes, the result
-
Is the singleton class single in threads?
I have a class designed by singleton pattern. I use this in many threads in one VM. I found every thread had a different instance. Why? And if I want to share information with different threads,how can I apply singleton in this context?
-
My e-mail works just fine, but my calendar doesn't sync. When I go to the menu in the e-mail application on my phone, and go to preferences, under AutoSync, the only option I have is "Sync: Mail" and I think it's supposed to have checkboxes for conta
-
Exe build error involvving internal.llb
Hi all, I have built many exe's, but for some reason this one is being difficult! I get an error which states: Error 1003 occurred at \\Rochester\mtp\Test Rigs\NC4\NC4 Air Cap\Code Development\Air cap v2.0\exe\internal.llb\Air Cap inspection Rig v2.