Set Horizontal Alignment on JLabel - wrong implementation?

Hi again.
I am studying by myself, and my last resort is to show you my unfinished code. This is supposed to move the alignment of the JLabel at the top of the window depending on the ComboBox choice. I did not implement the other ItemListeners yet because I can't make the first one work. I know I have an error somewhere... anyway thanks in advance for your time.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DemoJLabel extends JFrame {
    private ImageIcon icon = new ImageIcon("image/grapes.gif");
    private JLabel jlblGrape = new JLabel("Grapes", icon, SwingConstants.CENTER);
    private String[] horizontalAlign = {"LEFT", "CENTER", "RIGHT",
        "LEADING", "TRAILING"
    private String[] verticalAlign = {"TOP", "CENTER", "BOTTOM"};
    private String[] horizontalTP = {"LEFT", "CENTER", "RIGHT", "LEADING",
        "TRAILING"
    private String[] verticalTP = {"TOP", "CENTER", "BOTTOM"};
    private JComboBox jcboHA = new JComboBox(horizontalAlign);
    private JComboBox jcboVA = new JComboBox(verticalAlign);
    private JComboBox jcboHT = new JComboBox(horizontalTP);
    private JComboBox jcboVT = new JComboBox(verticalTP);
    public DemoJLabel() {
        JPanel p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        p1.add(jlblGrape);
        JPanel p2 = new JPanel();
        p2.setLayout(new GridLayout(2, 1));
        p2.add(new JLabel("Horizontal"));
        p2.add(new JLabel("Vertical"));
        JPanel p3 = new JPanel();
        p3.setLayout(new GridLayout(2, 1));
        p3.add(jcboHA);
        p3.add(jcboVA);
        JPanel p4 = new JPanel();
        p4.setLayout(new BorderLayout());
        p4.setBorder(BorderFactory.createTitledBorder("Alignment"));
        p4.add(p2, BorderLayout.WEST);
        p4.add(p3, BorderLayout.EAST);
        JPanel p5 = new JPanel();
        p5.setLayout(new GridLayout(2, 1));
        p5.add(new JLabel("Horizontal"));
        p5.add(new JLabel("Vertical"));
        JPanel p6 = new JPanel();
        p6.setLayout(new GridLayout(2, 1));
        p6.add(jcboHT);
        p6.add(jcboVT);
        JPanel p7 = new JPanel();
        p7.setLayout(new BorderLayout());
        p7.setBorder(BorderFactory.createTitledBorder("Text Position"));
        p7.add(p5, BorderLayout.WEST);
        p7.add(p6, BorderLayout.EAST);
        JPanel p8 = new JPanel();
        p8.setLayout(new GridLayout());
        p8.add(p4);
        p8.add(p7);
        setLayout(new GridLayout(2, 1));
        add(p1);
        add(p8);
        jcboHA.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                //For debugging
                System.out.println(jcboHA.getSelectedItem());
                String choice = jcboHA.getSelectedItem().toString();
                if (choice.equals("LEFT")) {
                    jlblGrape.setHorizontalAlignment(JLabel.LEFT);
                } else if (choice.equals("CENTER")) {
                    jlblGrape.setHorizontalAlignment(JLabel.CENTER);
                } else if (choice.equals("RIGHT")) {
                    jlblGrape.setHorizontalAlignment(JLabel.RIGHT);
                } else if (choice.equals("LEADING")) {
                    jlblGrape.setHorizontalAlignment(JLabel.LEADING);
                } else {
                    jlblGrape.setHorizontalAlignment(JLabel.TRAILING);
    // Other ItemListeners for the other combo boxes
    public static void main(String[] args) {
        DemoJLabel frame = new DemoJLabel();
        frame.setTitle("Demonstrating JLabel");
        frame.setSize(400, 350);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
}

*@petes1234*
Thanks! I didn't think about declaring p1 so that it could be changed.
* with assistance from petes1234
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DemoJLabel extends JFrame
    //** make the label's panel visible to the whole class
    private JPanel p1;
    private ImageIcon icon = new ImageIcon("image/grapes.gif");
    private JLabel jlblGrape = new JLabel("Grapes", icon, SwingConstants.CENTER);
    private String[] horizontalAlign =
    { "LEFT", "CENTER", "RIGHT", "LEADING", "TRAILING" };
    private String[] verticalAlign =
    { "TOP", "CENTER", "BOTTOM" };
    private String[] horizontalTP =
    { "LEFT", "CENTER", "RIGHT", "LEADING", "TRAILING" };
    private String[] verticalTP =
    { "TOP", "CENTER", "BOTTOM" };
    private JComboBox jcboHA = new JComboBox(horizontalAlign);
    private JComboBox jcboVA = new JComboBox(verticalAlign);
    private JComboBox jcboHT = new JComboBox(horizontalTP);
    private JComboBox jcboVT = new JComboBox(verticalTP);
    public DemoJLabel()
        //** make label bigger so we can see it
        //** the text moving around inside of it
        int labelSize = 160;
        jlblGrape.setPreferredSize(new Dimension(2 * labelSize, labelSize - 15));
        //** give it a border so we can see its bounds
        jlblGrape.setBorder(BorderFactory.createLineBorder(Color.blue));
        p1 = new JPanel();
        p1.setLayout(new FlowLayout());
        p1.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        p1.add(jlblGrape);
        JPanel p2 = new JPanel();
        p2.setLayout(new GridLayout(2, 1));
        p2.add(new JLabel("Horizontal"));
        p2.add(new JLabel("Vertical"));
        JPanel p3 = new JPanel();
        p3.setLayout(new GridLayout(2, 1));
        p3.add(jcboHA);
        p3.add(jcboVA);
        JPanel p4 = new JPanel();
        p4.setLayout(new BorderLayout());
        p4.setBorder(BorderFactory.createTitledBorder("Alignment"));
        p4.add(p2, BorderLayout.WEST);
        p4.add(p3, BorderLayout.EAST);
        JPanel p5 = new JPanel();
        p5.setLayout(new GridLayout(2, 1));
        p5.add(new JLabel("Horizontal"));
        p5.add(new JLabel("Vertical"));
        JPanel p6 = new JPanel();
        p6.setLayout(new GridLayout(2, 1));
        p6.add(jcboHT);
        p6.add(jcboVT);
        JPanel p7 = new JPanel();
        p7.setLayout(new BorderLayout());
        p7.setBorder(BorderFactory.createTitledBorder("Text Position"));
        p7.add(p5, BorderLayout.WEST);
        p7.add(p6, BorderLayout.EAST);
        JPanel p8 = new JPanel();
        p8.setLayout(new GridLayout());
        p8.add(p4);
        p8.add(p7);
        setLayout(new GridLayout(2, 1));
        add(p1);
        add(p8);
        jcboHA.addItemListener(new ItemListener()
            public void itemStateChanged(ItemEvent e)
                String choice = jcboHA.getSelectedItem().toString();
                if (choice.equals("LEFT"))
                    jlblGrape.setHorizontalAlignment(JLabel.LEFT);
                else if (choice.equals("CENTER"))
                    jlblGrape.setHorizontalAlignment(JLabel.CENTER);
                else if (choice.equals("RIGHT"))
                    jlblGrape.setHorizontalAlignment(JLabel.RIGHT);
                else if (choice.equals("LEADING"))
                    jlblGrape.setHorizontalAlignment(JLabel.LEADING);
                else
                    jlblGrape.setHorizontalAlignment(JLabel.TRAILING);
                //** revalidate the panel after making changes
                p1.revalidate();
        jcboVA.addItemListener(new ItemListener()
            public void itemStateChanged(ItemEvent e)
                String choice = jcboVA.getSelectedItem().toString();
                if (choice.equals("TOP"))
                    jlblGrape.setVerticalAlignment(JLabel.TOP);
                else if (choice.equals("CENTER"))
                    jlblGrape.setVerticalAlignment(JLabel.CENTER);
                else
                    jlblGrape.setVerticalAlignment(JLabel.BOTTOM);
                //** revalidate the panel after making changes
                p1.revalidate();
        jcboHT.addItemListener(new ItemListener()
            public void itemStateChanged(ItemEvent e)
                String choice = jcboHT.getSelectedItem().toString();
                if (choice.equals("LEFT"))
                    jlblGrape.setHorizontalTextPosition(JLabel.LEFT);
                else if (choice.equals("CENTER"))
                    jlblGrape.setHorizontalTextPosition(JLabel.CENTER);
                else if (choice.equals("RIGHT"))
                    jlblGrape.setHorizontalTextPosition(JLabel.RIGHT);
                else if (choice.equals("LEADING"))
                    jlblGrape.setHorizontalTextPosition(JLabel.LEADING);
                else
                    jlblGrape.setHorizontalTextPosition(JLabel.TRAILING);
                //** revalidate the panel after making changes
                p1.revalidate();
         jcboVT.addItemListener(new ItemListener()
            public void itemStateChanged(ItemEvent e)
                String choice = jcboVT.getSelectedItem().toString();
                if (choice.equals("TOP"))
                    jlblGrape.setVerticalTextPosition(JLabel.TOP);
                else if (choice.equals("CENTER"))
                    jlblGrape.setVerticalTextPosition(JLabel.CENTER);
                else
                    jlblGrape.setVerticalTextPosition(JLabel.BOTTOM);
                //** revalidate the panel after making changes
                p1.revalidate();
    public static void main(String[] args)
        DemoJLabel frame = new DemoJLabel();
        frame.setTitle("Demonstrating JLabel");
        frame.setSize(400, 350);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
}Edited by: carlshark on Dec 18, 2007 4:30 AM
Removed unnecessary debugging code

Similar Messages

  • Custom Table Cell Renderer Unable To Set Horizontal Alignment

    Hello,
    I have a problem that I'm at my wit's end with, and I was hoping for some help.
    I need to render the cells in my table differently (alignment, colors, etc) depending on the row AND the column, not just the column. I've got this working just fine, except for changing the cell's horizontal alignment won't work.
    I have a CustomCellRenderer that extends DefaultTableCellRenderer and overrides the getTableCellRendererComponent() method, setting the foreground/background colors and horizontal alignment of the cell based on the cell's value.
    I have a CustomTable that extends JTable and overrides the getCellRenderer(int row, int column) method to return a private instance of this CustomCellRenderer.
    This works fine for foreground/background colors, but my calls to setHorizontalAlignment() in the getTableCellRendererComponent() seem to have no effect, every cell is always displayed LEFT aligned! It's almost like the cell's alignment is determined by something else than the table.getCellRenderer(row,column).getTableCellRendererComponent() method.
    I've also tried setting the renderer for every existing TableColumn in the TableModel to this custom renderer, as well as overriding the table's getDefaultColumn() method to return this custom renderer as well for any Class parameter, with no success.
    No matter what I've tried, I can customize the cell however I want, EXCEPT for the horizontal alignment!!!
    Any ideas???
    Here's the core custom classes that I'm using:
    class CustomTable extends JTable {
    private CustomRenderer customRenderer = new CustomRenderer();
    public CustomTable() {
    super();
    public TableCellRenderer getCellRenderer(int row, int column) {
    return customRenderer;
    } // end class CustomTable
    class CustomRenderer extends DefaultTableCellRenderer {
    public CustomRenderer() {
    super();
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    if (row % 2 == 0) {
    setForeground(Color.red);
    setHorizontalAlignment(RIGHT);
    } else {
    setForeground(Color.blue);
    setHorizontalAlignment(LEFT);
    return this;
    } // end class CustomRenderer
    Even worse, I've gotten this to work fine in a trivial example I made to try and re-create the problem. But for some reason, this same thing is just not working for horizontal alignment in my actual project?!?
    Anyone have any ideas how the cell's horizontal alignment set in the getTableCellRendererComponent() method is being ignored or overwritten before the cell is being displayed???
    Thanks, any help is appreciated,
    -Alex Blume

    Ok, so I've looked into their source and I think I know where and what the trouble is. The JTable.java has a method called:
    3658> public TableCellRenderer getCellRenderer(int row, int column) {
    3659> TableColumn tableColumn = getColumnModel().getColumn(column);
    3660> TableCellRenderer renderer = tableColumn.getCellRenderer();
    3661> if (renderer == null) {
    3662> renderer = getDefaultRenderer(getColumnClass(column));
    3663> }
    3664> return renderer;
    3665> }
    starting at line 3658 of their source code. It retrieves the TableCellRenderer on line 3660 by calling the tableColumn's getCellRenderer method. This is found in the TableColumn.java class:
    421> public TableCellRenderer getCellRenderer() {
    422> return cellRenderer;
    423> }
    See the problem? Only ONE cell Renderer. It's referring to a variable found at line 140 which is of type TableCellRenderer ... well actually it's created as a DefaultTableCellRenderer at some point since TableCellRenderer is an interface.
    Basically the fix is this:
    In the TableColumn.java file, a collection (Vector, LinkedList, whatever) needs to keep track of each cell's renderer. This will solve the solution. Of course this will be something that you or I can make.
    What's funny is the contradiction in documentation between JTable's and TableColumn's getCellRenderer() method. First, if we look at TableColumn's documentation it states:
    "Returns the TableCellRenderer used by the JTable to draw values for this column."
    Based on that first statement, the getCellRenderer() method in TableColumn is doing its job exactly. No lies, no contradictions in what it does.
    However, that method is called up inside of the JTable's getCellRenderer() method which says a completely different thing which is:
    "Returns an appropriate renderer for the cell specified by this row and column."
    Now we have a problem. For the cell specified. It appears that the rush to push this out blinded some developer who either:
    1) mis-interpreted what the JTable getCellRenderer() method was supposed to do and inadvertently added a feature or;
    2) was in a 2 a.m. blitz, wired on Pepsi and adrenalin and wrote the bug in.
    Either way, I'm really hoping that they'll fix this because it will take care of at least 2 bugs. Btw, anyone interested in posting a subclass to solve this problem (subclass of TableColumn) is more than welcome. I've spent much too much time on this and my project is already behind so I can't really afford any more time on this.
    later,
    a.

  • Horizontal alignment for Text of Header Region

    Hi,
    The content of Text property for a header Region appears left aligned by default.
    Is it possible to set horizontal Alignment = Middle(of the Page)For the Item Type, Header I do not see any property called Horizontal Alignment in the Property Inspector.
    Thanks,
    Gowtam.

    Header component does not expose any property to align the text.
    Can you check whether, the following layout helps.
    TableLayout (Horizontal Alignment - center)
    |
    -- RowLayout (Horizontal Alignment - center)
    |
    --- CellFormat (Horizontal Alignment - center)
    |
    ---- Header

  • Cell horizontal alignment

    Hi,
    does someone know how to set the horizontal alignment of a cell ???
    Thanks, Fred.

    A JTable object provides a TableCellRenderer object for each of its column. It usually takes it from the TableColumn object provided by its own TableColumnModel, if available, or otherwise provides a DefaultTableCellRenderer object. This default cell renderer is basically a JLabel formatted according to the type of value it has to display.
    You can write your own cell renderer, e.g. a JLabel that you format as you wish, and set it as the default cell renderer for the table using the setDefaultRenderer method.
    Or you can overwrite the getCellRenderer method of the table and have it return the appropriate cell renderer for a column.
    Or you can write your own TableColumnModel and have it used by the table.
    The chosen solution depends on what you really need to do. Hope it helps.

  • Having problems setting text to a JLabel!!

    HI *.*,
    i'm having problems setting text to a JLabel.
    i have a JFrame with a JPanels and on the JPanel i have a JLabel.
    I have a text field wihich is used to input text.
    So, i'm using textField.getText() to read the text of the text field and setText() to write it to the Label.
    but setText() isn't displaying the text on the label.
    I'm using NetBeans as an ide
    Does anyone have any ideas??

    Here is some code
    public class AddClass extends JFrame implements ActionListener{
        public AddClass() {
            initComponents();
        }//end of 1st constructor with initComp
        //initComponents
        private void initComponents() {
            getContentPane().setLayout(new java.awt.GridLayout(3, 1));
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            prodPanel.setLayout(new java.awt.GridLayout(1, 3));
            prodPanel.setBackground(new java.awt.Color(255, 255, 255));
            prodPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Production", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12)));
            westPanel.setLayout(new java.awt.GridLayout(6, 0));
            westPanel.setBackground(new java.awt.Color(255, 255, 255));
            westPanel.add(westLab1);
            westLab2.setBackground(new java.awt.Color(255, 255, 255));
            westLab2.setFont(new java.awt.Font("Arial", 1, 36));
            westLab2.setForeground(new java.awt.Color(0, 204, 0));
            westLab2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            westLab2.setIcon(new javax.swing.ImageIcon("C:\\icontexto-webdev-bullet-048x048.png"));
            westLab2.setText("MQ 35");
            westLab2.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
            westLab2.setIconTextGap(10);
            westLab2.setInheritsPopupMenu(false);
            westPanel.add(westLab2);
            westPanel.add(westLab3);
            westPanel.add(westLab4);
            westPanel.add(westLab5);
            prodPanel.add(westPanel);
            setJMenuBar(menuBar);
            setTitle("Broker Monitor");
            this.setSize(700, 700);
            BrokerWindowCloser brkWindowCloser = new BrokerWindowCloser();
            this.addWindowListener(brkWindowCloser);
            pack();
            //       setVisible(true);
        }//end of initComponents
        public AddClass(String st) {
            initComponents();
            westLab6.setVisible(true);
    //        System.out.println("in broker  " + st); 
            westLab6.setText(st);
            System.out.println(st);
            westLab6.setBackground(new java.awt.Color(255, 255, 255));
            westLab6.setFont(new java.awt.Font("Arial", 1, 36));
            westLab6.setForeground(new java.awt.Color(0, 204, 0));
            westLab6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            westLab6.setIcon(new javax.swing.ImageIcon("C:\\PNG\\icontexto-webdev-bullet-048x048.png"));
            westLab6.setEnabled(true);
            westLab6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
            westLab6.setIconTextGap(15);
            westLab6.setInheritsPopupMenu(false);
            westPanel.add(westLab6);
    //       this.validate();
            westPanel.repaint();
        public void actionPerformed(ActionEvent ae) {
            Object source = ae.getSource();
            if(source == exitMI) {
                System.exit(0);
            }//end of if exitMI
            if(source == addMI){
                new AddMQ_1_1();
            if(source == removeMI){
                new RemoveMQ_1();
        }//end of actionPerformed
        class BrokerWindowCloser extends WindowAdapter {
            public void windowClosing(WindowEvent we) {
        }//end of windowcloserclass
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new AddClass().setVisible(true);
        }//end of main
    }// End of variables declaration
       public void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
            Object source = evt.getSource();
            if(source == addButton){
                System.out.println("here");
                String st = mqNameJTF.getText();
                Broker1 br = new Broker1(st);
                AddClass adc = new AddClass(st);
                this.repaint();
    this.dispose();
            }//end of if addButton
        }//end addButtonActionPerformed

  • JTextArea horizontal alignment

    I want to control the alignment of text in a JTextArea control (alignment left, center or right). I assume that I need to make a custom renderer of some description to be able to draw the text in the appropriate alignment,
    but if this is the case, I cannot work out how to setup the components.
    I appreciate that the JTextPane provides for setting of paragraph alignment attributes, but in my situation I need to use the JTextArea (the user needs to be able to turn line wrap on and off at run time so I need to make use of the JTextArea lineWrap facility).
    Is there any way that I can get the JTextArea to support the horizontal alignment??
    Any assistance would be greatly appreciated,
    regards, Sean

    I just realised that using a JTextPane would be acceptable as long as I could allow the user to turn on and off the line wrapping behaviour of the JTextPane. Does anybody know how to achieve that?
    Thanks, Sean

  • Chess UI Code Posted... Problems setting the background of JLabel.

    import javax.swing.*;
    import java.awt.*;
    import javax.swing.border.*;
    class chess
         JLabel l[];
         JPanel p;
         public chess()
              l = new JLabel[65];
              p= new JPanel();
              p.setLayout(new GridLayout(8,8));
              p.setBorder(new MatteBorder(2,2,2,2,Color.black));
              for(int i = 1; i<=64; i++)
                   l[i] = new JLabel(""+i);
                   p.add(l);
              JFrame f = new JFrame ("Hello");
              f.getContentPane().add(p);
              f.setSize(500,500);
              f.setVisible(true);
         public static void main(String args[])
              new chess();
    hello, i have created an array of JLabel and i wannt to set the background of JLabel white n black.. But when i write this statement it does not work..though it shud.
              if (i%2==0)
                   l.setBackground(Color.black);
              else
                   l[i].setBackground(Color.white);
    where i am going wrong n wht is the way to do this...

    can u tell wht shud i use in the if else block coz... the output is not wht i was expecting....u nd 2 chng clr wn lb @ % 8

  • Setting Vertical alignment

    I know how to set vertical alignment in a Microsoft Word document.
    I have been unable to find out how to do the same thing in Pages '08.
    I know it has to be there because if I open a document in Pages that was created with Microsoft Word that has vertical alignment set to center it is recognized by Pages.
    Any suggestions??
    Peter

    I do not think it is available through the UI. The way to add vertical alignment to a page is to copy a page from a converted Word document and paste it to your Pages document.
    It does not seem like Pages XML is currently fully documented, even though it has been claimed to be. I thought it would be here but that is not for the current version, and it is incomplete.
    I would guess it is this kind of information:
    <pre>
    <sf:verticalAlignment>
    <sf:number sfa:number="1" sfa:type="i"/>
    </sf:verticalAlignment>
    </pre>
    However, searching Apple's developer connection gives no confirmation.

  • How to set H align of title for columnGroup

    Hi
    advancedTable has columnGroup and this columnGroup has two different columnGroups as child.
    The title of top columnGroup is located at left side however thoes of two children(columnGroup) are at center.
    I want to place the title of top columnGroup at center.
    Please advise how to set H align of columnGroup's title or show me any other ways.
    Thanks..
    Message was edited by:
    user604638

    The following assumes that you are using ICM with an IPIVR etc (not using CVP), as the answer is different for CVP
    What you are looking for is called "Ring no answer time".  It is set in the Agent Desk Setting List tool.
    Regards,
    Kevin

  • How to set field alignment in a table in jdev 11.1.2.3?

    hi,
    How to set field alignment in a table in jdev 11.1.2.3?
    eg: to diplay a number field in a table as right aligned.
    I have tried to set field(amount) VO UI Hint Format Type:Number; Format: 0000.00
    and jspx as flowing, but it doesnot work.
    Thanks.
    bao
    <af:column sortProperty="#{bindings.VO1.hints.Amount.name}"
    sortable="true"
    headerText="#{bindings.VO1.hints.Amount.label}"
    id="c44" width="60"
    align="center">
    <af:inputText value="#{row.bindings.Amount.inputValue}"
    label="#{bindings.VO1.hints.Amount.label}"
    required="#{bindings.VO1.hints.Amount.mandatory}"
    columns="#{bindings.VO1.hints.Amount.displayWidth}"
    maximumLength="#{bindings.VO1.hints.Amount.precision}"
    shortDesc="#{bindings.VO1.hints.Amount.tooltip}"
    id="it58"
    secret="false"
    inlineStyle="text-decoration:overline;">
    <f:validator binding="#{row.bindings.Amount.validator}"/>
    </af:inputText>
    </af:column>

    Works for me:
            <af:column sortProperty="#{bindings.EmployeesView1.hints.Salary.name}" sortable="false"
                       headerText="#{bindings.EmployeesView1.hints.Salary.label}" id="c7" align="right">
              <af:inputText value="#{row.bindings.Salary.inputValue}" label="#{bindings.EmployeesView1.hints.Salary.label}"
                            required="#{bindings.EmployeesView1.hints.Salary.mandatory}"
                            columns="#{bindings.EmployeesView1.hints.Salary.displayWidth}"
                            maximumLength="#{bindings.EmployeesView1.hints.Salary.precision}"
                            shortDesc="#{bindings.EmployeesView1.hints.Salary.tooltip}" id="it6">
                <f:validator binding="#{row.bindings.Salary.validator}"/>
              </af:inputText>
            </af:column>JDeveloper 11.1.2.3
    Salary is shown right-aligned.
    What happens if you get rid of your inlineStyle on the af:inputText

  • How to set column alignment in JTable

    I make a table with JTable(Vector a, Vector b).
    I don't know how to set the alignment to right while the column type is Integer or Long.
    Do i have to use JTable(Object[][] a, Object[] b) ?

    Well , you can configure the alignment when you are creating the column, like
    for (int i=0; i<7; i++){
    //Size of cell
    int colunaTam = 50;
    //Define Allingment
    int cellAlinhamento = 4; //Right Aligment
    //Column
    javax.swing.table.TableColumn coluna;
    BusinessObjects.CellColorRenderer renderer = new BusinessObjects.CellColorRenderer();
    //Define alingment in cell render
    renderer.setHorizontalAlignment(cellAlinhamento);
    coluna = new javax.swing.table.TableColumn(i, colunaTam, renderer, null);
    ivjJTableDespachos.addColumn(coluna);
    Hope i help you...
    Ice

  • How to set specific height in JLabel but vary in width ...

    Hi,
    I want to set the height of JLabel to fix height but vary the width according to the content of the label...
    How does I do that ??
    JLabel lbl = new JLabel("Hello this is aman");
    lbl.setPreferredSize(100,30);
    If the the text is changed, the width will be truncated at 100 pixels... how do I change
    that to height 30, but width change according to text ?
    thank

    Hi..
    may be this works for you ---
    since u want to adjust the width with the text size.. means that you will be taking an input from the user and then set it on the label.. so before setting the text on the label & width of label .. get the length of the text and set this length as the width parameter to method setPrefferedSize()..
    ex:
    // get the text from textbox
    String userinp = textbox.getext();
    JLabel lbl = new JLabel();
    lbl.setPreferredSize(userinp.length,30);
    lbl.setText(userinp);

  • Set Stroke Alignment from JavaScript

    Hi,
    I'm trying to set the stroke style for a path item I've drawn through JavaScript, however I can't find a way to set the stroke alignment for my path item.
    I've checked the Illustrator JavaScript reference but I can't seem to find that option in there.
    I would expect something like:
    pathItem.strokeAlignment = StrokeAlignment.OUTSIDE; // This doesn't work, what is the correct way to set the stroke alignment from JavaScript?
    If I change the option in the Actions Panel it comes up as 'Set Stroke/Alignment: Outside', so there must be an equivalent way of setting it from JavaScript.
    Is there a way of converting Actions to JavaScript so you can see which properties and attributes are being set on the object?
    Does anyone know the correct way to set the strok alignment from JavaScript?
    Thanks!

    You can only call an action from JavaScript in CS6… (I don't have this). Up until then it was AppleScript and Visual Basic only…
    Document raster effects you do have access to…
    Class
    RasterEffectOptions
    The document raster effects settings.
    Class
    Property
    Type
    Access
    Description
    antiAliasing
    bool
    r/w
    Should the resulting image be antialiased. (default: false)
    clippingMask
    bool
    r/w
    Should a clipping mask be created for the resulting image. (default: false)
    colorModel
    RasterizationColorModel:
    RasterizationColorModel.DEFAULTCOLORMODEL
    RasterizationColorModel.GRAYSCALE
    RasterizationColorModel.BITMAP
    r/w
    The color model for the rasterization. (default: RasterizationColorModel.DEFAULTCOLORMODEL)
    convertSpotColors
    bool
    r/w
    Whether to convert all spot colors to process colors in the resulting image. (default: false)
    padding
    number
    r/w
    The amount of white space (in points) to be added around the object during rasterization. (default: 0)
    resolution
    number (range: 72.0 - 2400.0)
    r/w
    The rasterization resolution in dots-per-inch (dpi) (default: 300)
    transparency
    bool
    r/w
    Should the resulting image use transparency. (default: false)

  • Control horizontal alignment of table cell?

    Is it possible to control the horizontal alignment of text within a table cell using some form of xsl:attribute code? I wasn't able to find any alignment attributes supported in the user guide and was hoping there was a way to manage it- the problem is that I don't know ahead of time which cells need to be left justified and which ones need to be centered.
    Thanks,
    Kevin

    I've tried the following in the
    advanced properties but with no success.
    <?if:number(EMPID)>6?>
    <xsl:attribute
    xdofo:ctx="block" name="text-align">center
    </xsl:attribute>
    <?end if?>
    Change the attribute to the following and the formatting works.
    <?if:number(EMPID)>6?>
    <xsl:attribute
    xdofo:ctx="block" name="background-color">red
    </xsl:attribute>
    <?end if?>
    I'm previewing in PDF.
    If anyone has any ideas they would be greatly appreciated.
    Thankyou
    John.

  • Adaptive Layout - Portlet horizontal alignment

    Is it possible to create an Adaptive Layout with horizontal alignment of portlets in a column?
    Attempting to create a layout with column1 above column 2 and column3 along right side of page.

    I apologize for the late response.
    I was not able to switch the alignment. I moved on to another approach due to limited time.
    Adaptive layouts are a composite of the base portal css styles and adaptive layout styles. It is difficult without a tool that is able to pull all the components into a single view based upon references. (Now that would be a useful tool.... anyone listening). The most useful tool i have found so far is Dreamweaver, it allows you to create custom tag libraries for limited design help.
    I welcome any input on a tool that can handle the tag libraries.
    I will update this thread if I make any discoveries.

Maybe you are looking for

  • Why is iTunes so difficult to navigate? It is the Windows 8 of the Apple world.

    I have read the user guides and spend countless hours using iTunes 12 - but I still find it extremely difficult to navigate. It seems to be designed by the same people who created that monstrosity Windows 8, which set Microsoft back years. Earlier ve

  • SCCM Report Services Instance missing

    Hi, Been trying to troubleshoot this for a day and had already done the following: 1. http://myitforum.com/myitforumwp/2012/10/10/reporting-services-site-role-setup-instance-blankempty/ 2. Reinstalled reporting services on SQL Database Server 3. http

  • Counting consecutive numbers into one row

    Hello everyone, I have recently discovered that we can use Max ( Decode ()) function of Oracle to pivot the results of a table. I have executed this just fine. However, pivoting a table is just one part of the solution that I need. The pivoting funct

  • IBooks Library not synching between iPad & Macbook Pro

    I've loaded PDFs into my iPad and Macbook Pro ibook libraries, but they are not synching between the devices. All synching has been turned on in preferences on my Mac, iTunes and iPad. Any suggestions as to how to get both devices listing same ibook

  • VDCAssistant process automatically being invoked when Flash in use

    I just updated my Flash to the latest version 11.2.202.228 on my 32-bit Mac Book Pro running OS 10.6.8. As of this most recent update I found that the VDCAssistant process (the process that normally runs when using Image Capture/Photo Booth) decides