How can I format a textfield control according to column width?

Hi!
Someone can help me?
I have a column on the database that is VARCHAR2(2).
On the frame , I want that the user enter a value delimited with 2 characters, but I don't now how.
I have changed de property of the column on the rowset of the view, but I don't have success.
Thank4s in advance for any help.
Vania
(Sorry for my bad english)

Here it is.
You can inastantiate a text field object of following class(limited two char input) like this:
myUpperCaseField myField = new myUpperCaseField(2);
Note: this class also upper cased the char input. You should doing some change in this code,if you are not concern on upper case.
import javax.swing.text.*;
import oracle.dacf.control.swing.*;
import java.awt.Toolkit;
public class myUpperCaseField extends TextFieldControl {
int fixedLength=0;
public myUpperCaseField(int cols) {
super(cols);
fixedLength = cols;
public myUpperCaseField() {
super();
fixedLength = 0;
protected Document createDefaultModel() {
return new UpperCaseDocument();
public void setFixedLength(int length){
if(length < 0){
fixedLength = 0;
else{
fixedLength = length;
public int getFixedLength(){
return fixedLength;
protected class UpperCaseDocument extends PlainDocument {
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
if(getFixedLength() > 0){
if(getLength() + str.length() > getFixedLength()){
Toolkit.getDefaultToolkit().beep();
return;
if (str == null) {
return;
char[] upper = str.toCharArray();
for (int i = 0; i < upper.length; ++i) {
upper[i] = Character.toUpperCase(upper);
super.insertString(offs, new String(upper), a);
}//end of class
null

Similar Messages

  • How can i find KKBER(Credit control area) accordding to BUKRS(Company Code)

    How can i find KKBER(Credit control area) accordding to BUKRS(Company Code).
    THANKS!!

    Aaawwwwwwwwww!  You guys are sweet 
    That table is blank  in my system.  I guess you can have credit controlling areas which are not tied to company codes?
    Regards,
    Rich Heilman

  • How can I format footnote fonts in pages--for all footnotes in a document?

    I am just starting to use Pages and am writing a paper with footnotes.  The paper is in Times New Roman 12, but the footnotes come automatically in Helvetica 10.  How can I format all the footnotes so they automatically appear in TNR 12?

    Change one word in a footnote
    Select that word
    In the Style drawer click on the triangle for the Footnote in the paragraph style section. You have to move the cursor to the left to see the trinagle
    Choose Redefine style from the selection

  • How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?

    How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?
    I have been using Windows to write files to my 1TB WD external hard drive and I do not want to format to loose the files capacity of around 500GB
    Someone, Please help

    Hi Allen,
    Is there any way to store the back up to Mac and restore after formating?

  • How can a format an external hard drive to Fat 32 format

    how can i format an external hard drive to a Fat 32

    Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to MBR then click on the OK button. Set the format type to MSDOS (FAT)  Click on the Partition button and wait until the process has completed.

  • HT1338 How can I format my hard drive without installation disk?

    Guys I am using Mac with OS X 10.6.5. How can I format hard drive without the installation disk?
    I don't have a installation disk can I buy one? where?

    Call Apple Sales at 1-800-692-7753 to order 10.6.
    Posts concerning 10.6 should be made in 10.6 usage forum.
    You posted in the 10.3 and down forum which is very old OSX software.
    DALE

  • How can I format a field in the form creator?

    How can I format a field in the form creator? It's putting the same text in all the fields within a table. I want each field within the table to have different text. As soon as you click out of the table, all the text is the same.
    I even changed the fields from a text box to a drop-down list so a person can make their selection, which will be a quantity from 0-9. There are two of these such fields. You make your selection in each, click off the table and both fields show whatever I selected in field 1. The original Qty I selected in the bottom field was a 5 but it changed it to whatever is in the top field on it's own. I've added a screen shot.

    This behaviors usually happens when you create the fields but  a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field  "company name" printed in each and every page of a multi-page form document.
    Go to the properties fields of each field and make sure  to assign unique form field  names.

  • I can disable one of my MacBook's two CPUs using the CPUPalette application.  How can I do it under control of a script?

    I can disable one of my MacBook's two processors using the CPUPalette application.  How can I do it under control of a script?
    I want to do this because the MacBook is overheating.  I will soon get it repaired, but in the meantime, disabling CPU 2 is effective at preventing overheating.  Sadly CPUPalette is not scriptable, and it won't remember its setting after the computer is restarted.
    Would it be worth learning about the relevant Darwin API (supposing there is one) and writing a small command-line program for the job?  I am an experienced developer of software using Standard C.
    Comments appreciated.
    Dave

    i wonder if there is a key that is stuck cause whenever i try to turn it on again after the 60 minute lockout, it says that the password was incorrect and i am locked out for another 60 minutes

  • How can I format my HP Pocket Media Drive?

    How can I format my pocket media drive in order to back up my pc correctly?  I'm using HP Slimline s5250t.

    Vista (7 is similar) : http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00853869&cc=us&lc=en&dlc=en
    ME/XP: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00208348&cc=us&lc=en&dlc=en
    ... an HP employee expressing his own opinion.
    Please post rather than send me a Message. It's good for the community and I might not be able to get back quickly. - Thank you.

  • How can I create variant of control query?

    Dear Expert,
    I am using BEx Broadcaster to bradcast query as a report.
    In tab Filter Navigation, I enter the control query, but the variant always gives me "(No Selection Possible)".
    How can I create variant of control query?
    I try to create variant via variable entry page when I excute my query.
    The variable show in table "RSRPARAMETRIZA" but not show in BEx Braodcaster.
    Thank you,
    Zilla

    Hello,
    Please run this control query on the portal and then save variant you require. If you want this variant to be available
    to all users make sure that the user specific flag is unchecked while saving the variant.
    Regards,
    Michael

  • How can I format the results?

    hi,
    I do this caculation
    double cal = 1.0/3.0;
    I just want the result like this "0.3333". How can I format this result?
    Thanks,
    Bin

    java.text.DecimalFormat xForm = new java.text.DecimalFormat("#, ##0.00");:)

  • How can I format my usb install drive?

    how can I format mymacbook air software install drive.?, the ones that came with the Macbook Air as the OS is now old I have no Use for the Drive and would like to use it as a stylish usb flash drive.
    the one I mean is here
    Is it actually possible to format it?
    thanks.

    It is showing up as a cd drive i should mention it is holding a 10.6 osx and so will not let me erase.
    any suggestions?
    thanks

  • How can I format my manuscript for my upcoming book?

    How can I format my manuscript for my upcoming book with adobe in design?

    "Manuscript" ≠ "book". Are you writing in InDesign itself, or do you use a regular word processor and intend to hand this over to a book designer?

  • How can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have

    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me

    Moh&#39;d . Hassan wrote:
    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me
    Then get the previous owner to remove it: Find My iPhone Activation Lock: Removing a device from a previous owner’s account - Apple Support

  • How can I format an HD with System 10.4 and install Leopard Snow?

    How can I format an HD with System 10.4 and install Leopard Snow?

    You need to partion the hard drive using Disk Utility. On one partition install 10.4. On the other 10.6. As a note I trust you are doing this on a MBP and not a PPC Mac because 10.6 won't install.

Maybe you are looking for