Strange behavior of JTable with TableCellRender.

Hi, all!
i am creating a graphic application using Swing. i wanna use a single column table to display list of pictures.
JScrollPane tablePane = new JScrollPane();
TableValues tv = new TableValues(TableValues.TYPE_FRAME);
JTable picTable = new JTable(tv);
picTable.setCellSelectionEnabled(true);
TableColumnModel tcm = picTable.getColumnModel();
TableColumn tc = tcm.getColumn(0);
tc.setCellRenderer(new PicRender());
tablePane.setViewportView(picTable);
this.getContentPane().add(tablePane);
When i run the code, the JTable seems refreshing the cells at all the time! (And i did not click anything or move the cursor above the table).
and CPU time runs as high as 99%!
Please help. Thank you in advance.
the following is my TableCellRender:
public class PicRender extends JLabel implements TableCellRenderer {
static Border selectedBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.magenta, Color.magenta);
static Border unselectedBorder = BorderFactory.createEmptyBorder();
static int counter = 0;
public PicRender() {
super();
System.out.println("Creating label");
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
try {
TableValues tv = (TableValues) table.getModel();
BufferedImage image = tv.getPic(row);
int imageHeight = image.getHeight();
int imageWidth = image.getWidth();
Icon icon = new ImageIcon(image);
//setIcon(icon);
setText("#" + row);
setToolTipText(tv.getToolTip(row));
table.setRowHeight(row, imageHeight + 10);
setHorizontalAlignment(SwingConstants.CENTER);
if(isSelected) {
setBorder(selectedBorder);
}else{
setBorder(unselectedBorder);
catch (Exception ex) {
setIcon(null);
setText("Thumbnails N/A");
System.out.println("Paint: " + row + "\t" + (++counter));
return this;
* The following methods copied from Sun's DefaultTableCellRender.java.
* Overridden for performance reasons.
public void validate() {}
public void revalidate() {}
public void repaint(long tm, int x, int y, int width, int height) {}
public void repaint(Rectangle r) {}
protected void firePropertyChange(String propertyName, Object oldValue,
Object newValue) {
// Strings get interned...
if (propertyName == "text") {
// super.firePropertyChange(propertyName, oldValue, newValue);
public void firePropertyChange(String propertyName, boolean oldValue,
boolean newValue) {}

It is probably related to the fact that you are setting the tables row height in the renderer this will fire a render message when the height changes. One height is applied to all rows of a table. This means that is you have images of different heights you are continually changing the tables row height and therefore continually rendereing.
My approach would be to have all the images fit into a set size ( say 64*64 ( with scaling if neccesary ) you could then have a popup show the full size image if required.

Similar Messages

  • Strange behavior of JTable..Help plz

    Hi,
    Assume i have 5 rows in my JTable. I wrote a function on right click i get a popup window with an option delete row, which deletes the row successfully,
    The problem is when i sort the data in JTable. on column click JTable is getting sorted, in which assume 2nd row got replaced with 4th row and vice versa.
    Now when i try to delete the 4th row, it is delete the 2nd row data, which was there at the place of 4th row before sorting. In this regard i am trying to print the row number before deleting. It is displaying as 4th, but deleting 2nd row.
    Hope i am clear. Please suggest me in solving this strange behavior of JTable sorting problem.
    Regards,
    Ravi

    MyTableModel tablemodel = new MyTableModel(colnames,values);
    TableSorter sorter = new TableSorter(tablemodel);
    JTable table = new JTable(sorter)
    tablemodel.removeRow(row); // last line is the code where i am deleting the row, it's deleting the wrong row.
    do i need to remove the last line code and make respective changes in TableSorter.java class.
    ore
    here itself do i need to do some changes. ?
    There is a method that will convert the view row to the model row private Row[] getViewToModel()
    my question is how TableSorter.java class comes to know that i am deleting the perticular row.

  • Strange behavior of entourage with shared IMAP folders

    Hi the list,
    I have a strange behavior with entourage 11.2.5 with shared IMAP folders. Here's what I'd like to do :
    All this has to do with spamassassin and spamtrainer. Some of our mails accounts are IMAP ones, but most are POP only and I don't want them to be IMAP. But I also want both IMAP and POP users to have some IMAP access to shared mailboxes for spam and ham to be learned. For those who are using IMAP accounts, that's not a problem with shared mailboxes. But, considering those with only POP accounts, I decided to create a dedicated user called anti_spam, using IMAP access, with two mail boxes that are spam and non_spam, so that all POP users could share this account.
    Using SirAdmin, I set l/p/i ACL rights for anyone and the same for anti-spam user so that mail can't be read back with this shared account. Everything just works fine with Mail, but it doesn't work with Entourage. I set up an IMAP account for anti_spam to get an access to shared mailboxes even if main account is a POP one. Everything's fine except I can't write anything on mailboxes : I get an error 1025 and a denied access for writing. The only way to get write access to these mailboxes is to add "r" ACL to them with SirAdmin, which is NOT the solution as it would allow anybody to read mails. It's obvious it has more to do with Entourage than OS X mail service, all the more trying the same conf in Thunderbird is OK as expected.
    I was just wondering if somebody here would have some idea of what could be wrong ...

    I'd be interested to hear if anyone has a solution too as am having the same problem of not being able to write to IMAP mailboxes.
    JJJ

  • Strange behavior of system with enabled FileVault2, Roaming profile

    Hello,
    I have encountered strange behavor of my Macbook Air after some testing.
    Macbook Air 2012 was newly installed with 10.8.4 and joined network account server on 10.8.4 server with Roaming profile (synced with server home directory). After installing some basic apps like iWork I turned on FileVault.
    Then I start to have the strange behavior - iWorks are not displaying content of document - it seams blank - just white screen without any borders where should be at least lines in numbers or empty cells.
    Another display problem is in Safari. On same pages (even default Top SItes) it`s flashing and especially when scrolling.
    Did you encountered something similar? I`m not able to get rid of it.
    Computers was used for some time before turining on FIle Vault and problem started to occur after this action. Disabling of FileVault didn`t helped (properly restarted between steps).
    I didn`t found anything strange in Console or elsewhere..

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, or by corruption of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain iMacs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Strange behavior when compiled with Visual C++ 2005 Express Edition

    I wrote a program for Berkeley DBXML 2.2.13 on Windows XP that executes a query 5 times and prints out the runtime for each execution. When I run the program using the Debug version of the libraries the queries take about the same time to execute for all 5 executions. When I run the program using the Release version of the libraries the execution time of the queries degrades significantly between each execution. One query takes 2 seconds to execute the first time and 20 to execute the last. I have tried recompiling the Release version without optimization and the strange behavior persists. I have run both the Release and Debug versions several times and gotten the same results, so I doubt it is a program running in the background that is slowing the execution.
    This behavior does not happen when I compile the program under Unbuntu using g++, so I assume it is caused by some flag set in the Release version of Visual C++. Has anyone else experienced this behavior and know what flags I should or should not set?
    Thanks for your time.
    Lauren

    Hi Lauren,
    We've had users experience this before, and it seems to be a bug/"feature" of the default windows heap allocator. Please see this post for a bit more explanation and a solution:
    Re: Performance Issue caused by XmlResults.next().asString();
    John

  • Strange behavior when resizing with 'Selection Tool'

    Hello,
    I have a really strange issue when using selection tool to resize object. I have several rectangles stacked and grouped inside a layer. When I select one of them (either in Layer panel or with Group selection tool) and switch to 'Selection Tool (V)' to resize it, this tool behaves diferently at diferent zoom levels. Only at 200% zoom it behaves as it shoul.. With 100-150% zoom result is diferent - like there's a invisible box around selected object and I'm resizing it.. I've tried to explain the issue in attached image.. Anyone knows why is this happening?
    Thanks.

    - make new document, size 16383x16383px
    - create rectangle any width, hight say 200px (or anything less then 320px for 5% zoom)
    - select rectangle and show bounding box
    - try resizing hight by stretching bounding box
    - this is how same selection looks at diferent zoom levels
    - same zoom level as befor, hight 100px..

  • Strange behavior in JTable using JFileChooser as custom editor

    I have an application that I am working on that uses a JFileChooser (customized to select images) as a custom editor for a JTable. The filechooser correctly comes up when I click (single click) on a cell in the table. I can use the filechooser to select an image. When I click on the OPEN button on the filechooser, the cell then displays the editor class name.
    I have added prints to the editor methods and have determined that editing is stopped before the JTable adds the listener. I have looked at the code and have searched doc for examples but have not found what I am doing wrong. Can anyone help?
    I configured the table editor as follows:
    //Set up the editor for the Image cells.
    private void setUpPictureEditor(JTable table) {
    table.setDefaultEditor(String.class, new PictureChooser());
    Below is the code for the JTable editor that I am using:
    package com.board;
    import java.io.*;
    import java.util.Vector;
    import java.util.EventObject;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JFileChooser;
    import javax.swing.JPanel;
    import javax.swing.table.TableCellEditor;
    import javax.swing.event.CellEditorListener;
    import javax.swing.event.ChangeEvent;
    public class PictureChooser extends JLabel implements TableCellEditor
    boolean DEBUG = true;
    int line=0;
    static private String newline = "\n";
    protected boolean editing;
    protected Vector listeners;
    protected File originalFile;
    protected JFileChooser fc = new JFileChooser("c:\\java\\jpg");
    protected File newFile;
    public PictureChooser()
    super("PictureChooser");
    if (DEBUG)
         System.out.println(++line + "-PictureChooser constructor");
         listeners = new Vector();
         fc.addChoosableFileFilter(new ImageFilter());
         fc.setFileView(new ImageFileView());
         fc.setAccessory(new ImagePreview(fc));
    private void setValue(File file)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.setValue method");
         newFile = file;
    public Component getTableCellEditorComponent(JTable table,
                                  Object value,
                                  boolean isSelected,
                                  int row,
                                  int col)
    if (DEBUG)
         System.out.println(line + "-PictureChooser.getTableCellEditorComponent row:" + row + " col:" + col + " method");
         fc.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   String cmd = e.getActionCommand();
                   System.out.println(++line + "-JFileChooser.actionListener cmd:" +
                                       cmd);
                   if (JFileChooser.APPROVE_SELECTION.equals(cmd))
                        stopCellEditing();
                   else
                        cancelCellEditing();
         //editing = true;
         //fc.setVisible(true);
         //fc.showOpenDialog(this);
         int returnVal = fc.showOpenDialog(this);
         if (returnVal == JFileChooser.APPROVE_OPTION)
         newFile = fc.getSelectedFile();
         table.setRowSelectionInterval(row,row);
         table.setColumnSelectionInterval(col,col);
         return this;
    // cell editor methods
    public void cancelCellEditing()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.cancelCellEditing method");
         fireEditingCanceled();
         editing = false;
         fc.setVisible(false);
    public Object getCellEditorValue()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.getCellEditorValue method");
         return new ImageIcon(newFile.toString());
    public boolean isCellEditable(EventObject eo)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.isCellEditable method");
         return true;
    public boolean shouldSelectCell(EventObject eo)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.shouldSelectCell method");
         return true;
    public boolean stopCellEditing()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.stopCellEditing method");
         fireEditingStopped();
         editing = false;
         fc.setVisible(false);
         return true;
    public void addCellEditorListener(CellEditorListener cel)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.addCellEditorListener method");
         listeners.addElement(cel);
    public void removeCellEditorListener(CellEditorListener cel)
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.removeCellEditorListener method");
         listeners.removeElement(cel);
    public void fireEditingCanceled()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.fireEditingCanceled method");
         setValue(originalFile);
         ChangeEvent ce = new ChangeEvent(this);
         for (int i=listeners.size()-1; i>=0; i--)
         ((CellEditorListener)listeners.elementAt(i)).editingCanceled(ce);
    public void fireEditingStopped()
    if (DEBUG)
         System.out.println(++line + "-PictureChooser.fireEditingStopped method");
         ChangeEvent ce = new ChangeEvent(this);
         for (int i=listeners.size()-1; i>=0; i--)
    System.out.println(++line + "-PictureChooser listener " + i);
         ((CellEditorListener)listeners.elementAt(i)).editingStopped(ce);

    try this code. it work fine.
    regards,
    pratap
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.io.*;
    public class TableDialogEditDemo extends JFrame {
         public TableDialogEditDemo() {
              super("TableDialogEditDemo");
              MyTableModel myModel = new MyTableModel();
              JTable table = new JTable(myModel);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              //Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(table);
              //Set up renderer and editor for the Favorite Color column.
              setUpColorRenderer(table);
              setUpColorEditor(table);
              //Add the scroll pane to this window.
              getContentPane().add(scrollPane, BorderLayout.CENTER);
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
         private void setUpColorRenderer(JTable table) {
              table.setDefaultRenderer(File.class, new PictureRenderer(true));
         //Set up the editor for the Color cells.
         private void setUpColorEditor(JTable table) {
              table.setDefaultEditor(File.class, new PictureChooser());
         class PictureRenderer extends JLabel     implements TableCellRenderer {
              Border unselectedBorder = null;
              Border selectedBorder = null;
              boolean isBordered = true;
              public PictureRenderer(boolean isBordered) {
                   super();
                   this.isBordered = isBordered;
                   setOpaque(false);
                   setHorizontalAlignment(SwingConstants.CENTER);
              public Component getTableCellRendererComponent(
                                            JTable table, Object value,
                                            boolean isSelected, boolean hasFocus,
                                            int row, int column) {
                   File f = (File)value;
                   try {
                        setIcon(new ImageIcon(f.toURL()));
                   catch (Exception e) {
                   e.printStackTrace();
                   return this;
         class MyTableModel extends AbstractTableModel {
              final String[] columnNames = {"First Name",
                                                 "Favorite Color",
                                                 "Sport",
                                                 "# of Years",
                                                 "Vegetarian"};
              final Object[][] data = {
                   {"Mary", new Color(153, 0, 153), "Snowboarding", new Integer(5), new File("D:\\html\\f1.gif")},
                   {"Alison", new Color(51, 51, 153), "Rowing", new Integer(3), new File("D:\\html\\f2.gif")},
                   {"Philip", Color.pink, "Pool", new Integer(7), new File("D:\\html\\f3.gif")}
              public int getColumnCount() {
                   return columnNames.length;
              public int getRowCount() {
                   return data.length;
              public String getColumnName(int col) {
                   return columnNames[col];
              public Object getValueAt(int row, int col) {
                   return data[row][col];
              public Class getColumnClass(int c) {
                   return getValueAt(0, c).getClass();
              public boolean isCellEditable(int row, int col) {
                   if (col < 1) {
                        return false;
                   } else {
                        return true;
              public void setValueAt(Object value, int row, int col) {
                   data[row][col] = value;
                   fireTableCellUpdated(row, col);
         public static void main(String[] args) {
              TableDialogEditDemo frame = new TableDialogEditDemo();
              frame.pack();
              frame.setVisible(true);
    import java.awt.Component;
    import java.util.EventObject;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.io.*;
    public class PictureChooser extends JButton implements TableCellEditor, ActionListener {
         protected EventListenerList listenerList = new EventListenerList();
         protected ChangeEvent changeEvent = new ChangeEvent(this);
         private File file;
         public PictureChooser() {
              super("");
              setBackground(Color.white);
              setBorderPainted(false);
              setMargin(new Insets(0,0,0,0));
              addActionListener(this);
         public Component getTableCellEditorComponent(JTable table, Object value,
                                                 boolean isSelected, int row, int column) {
         File f = (File)value;
         try {
              setIcon(new ImageIcon(f.toURL()));
         catch (Exception e) {
              e.printStackTrace();
         return this;
         public void actionPerformed(ActionEvent e)
         JFileChooser chooser = new JFileChooser("d:\\html");
         int returnVal = chooser.showOpenDialog(this);
              if(returnVal == JFileChooser.APPROVE_OPTION) {
                   file = chooser.getSelectedFile();
                   System.out.println("You chose to open this file: " + chooser.getSelectedFile().getName());
                   fireEditingStopped();
              else
                   fireEditingCanceled();
         public void addCellEditorListener(CellEditorListener listener) {
         listenerList.add(CellEditorListener.class, listener);
         public void removeCellEditorListener(CellEditorListener listener) {
         listenerList.remove(CellEditorListener.class, listener);
         protected void fireEditingStopped() {
         System.out.println("fireEditingStopped called ");
         CellEditorListener listener;
         Object[] listeners = listenerList.getListenerList();
         for (int i = 0; i < listeners.length; i++) {
              if (listeners[i] == CellEditorListener.class) {
              listener = (CellEditorListener) listeners[i + 1];
              listener.editingStopped(changeEvent);
         protected void fireEditingCanceled() {
         CellEditorListener listener;
         Object[] listeners = listenerList.getListenerList();
         for (int i = 0; i < listeners.length; i++) {
              if (listeners[i] == CellEditorListener.class) {
              listener = (CellEditorListener) listeners[i + 1];
              listener.editingCanceled(changeEvent);
         public void cancelCellEditing() {
         System.out.println("cancelCellEditing called ");
         fireEditingCanceled();
         public boolean stopCellEditing() {
         System.out.println("stopCellEditing called ");
         fireEditingStopped();
         return true;
         public boolean isCellEditable(EventObject event) {
         return true;
         public boolean shouldSelectCell(EventObject event) {
         return true;
         public Object getCellEditorValue() {
              return file;

  • Strange behavior Lion SMB with Vista clients

    Hi,
    I have a problem with the SMB server in Lion. The configuration is as followes:
    - Server: Lion Server (10.7.1) on Mac Mini
    - Clients: Mixed, WinXP/Vista/7, 10.6/10.7
    Problem:
    Vista client have a problem with the SMB shares on Lion.
    When I add for example a new folder, in explorer the folder shows up as "ew Folder" instead of "New Folder".
    When I try to change the name of the created folder, Windows report it can't find the folder. When I refresh the explorer, the foldername is correct.
    It also occurs when creating new files, change files, etc.
    It only happens on the Windows Vista client, on Windows XP/7 I have no problems with it.
    I can reproduce the problem. On a clean install of 10.7 server and Win Vista the problems exists.

    Even after 10.7.2 Server upgrade the problem described byJeroen still remain.
    Did someone has a Windows Vista client machine that write files and folders correctly to an SMB share on Lion?
    When I say correctly i mean with correct name (example: in my network vista machine can write in SMB share on Lion, but when we add a new folder, this news folder is shown with "ew Folder" instead of "New Folder. Only refreshing explorer we can see the real correct folder name).
    This problem doesn't affect ours XP and Vindows 7 clients that are working very well.
    Any ideas and solutions?
    thanks

  • Strange behavior with Zoom and Image control

    HELP - I have a strange behavior (bug?) with using Zoom
    effect on an Image that has been placed on a Canvas. I am using
    dynamically instantiated images which are placed on a canvas inside
    a panel. I then assign a Zoom IN and Zoom Out behavior to the
    image, triggered by ROLL_OVER and ROLL_OUT effect triggers. THE BUG
    is that the image jumps around on the Zoom OUT and lands on a
    random place on the canvas instead of coming back to the original
    spot. This is especially true if the mouse goes in and out of the
    image very quickly. HELP -- what am I doing wrong? Computer = Mac
    OS X 10.4.9 Flex 2.0.1
    Here's a simple demo of the bug -- be sure to move the mouse
    in and out rapidly:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="setUp();">
    <mx:Script><![CDATA[
    import mx.events.EffectEvent;
    import mx.effects.Fade;
    import mx.effects.Zoom;
    import mx.rpc.events.ResultEvent;
    import flash.display.Sprite;
    import mx.core.UIComponent;
    import mx.controls.Image;
    private var zoomIn:Zoom;
    private var zoomOut:Zoom;
    private function setUp():void {
    var image:Image = new Image();
    image.id = "album_1_1";
    image.x = 200;
    image.y = 200;
    image.width = 64;
    image.height = 64;
    image.source = "
    http://s3.amazonaws.com/davidmccallie/album-128.jpg";
    image.addEventListener(MouseEvent.ROLL_OVER, doZoom);
    image.addEventListener(MouseEvent.ROLL_OUT, doZoom);
    myCanvas.addChild(image);
    zoomIn = new Zoom();
    zoomIn.zoomHeightTo = 2.0;
    zoomIn.zoomWidthTo = 2.0;
    zoomIn.captureRollEvents = true;
    zoomIn.suspendBackgroundProcessing = true;
    zoomOut = new Zoom();
    zoomOut.zoomHeightTo = 1.0;
    zoomOut.zoomWidthTo = 1.0;
    zoomOut.captureRollEvents = true;
    zoomOut.suspendBackgroundProcessing = true;
    private function doZoom(event:MouseEvent):void {
    var image:Image = Image(event.currentTarget);
    if (event.type == MouseEvent.ROLL_OVER) {
    zoomIn.target = event.currentTarget;
    zoomIn.play();
    } else if (event.type == MouseEvent.ROLL_OUT) {
    zoomOut.target = event.currentTarget;
    zoomOut.play();
    ]]>
    </mx:Script>
    <mx:Panel width="100%" height="100%"
    layout="absolute">
    <mx:Canvas id="myCanvas" width="100%" height="100%">
    </mx:Canvas>
    </mx:Panel>
    </mx:Application>

    There must be bugs in the Zoom effect code -- I changed the
    Zoom to Resize in the above code, and it works perfectly. Of
    course, Resize is not as nice as Zoom because you can't set the
    resize to be around the center of the image, but at least it works.
    Does anyone know about bugs in the Zoom effect?

  • Strange behavior with DefaultCellEditor

    Hello everybody,
    I found a strange behavior with DefaultCellEditor using a JTextField in a JTable. The following line will show, what I mean:
    setDefaultCellEditor(String.class,new DefaultCellEditor(new JTextField()));
    Imho this should do the same as JTable does already, when it installs a JTextField as default cell editor for cell values of the String class. But, it seems, that it is not the same:
    When I add this line in the constructor of a JTable subclass the editor component seems to be less wide and less high to the right and bottom - it looks so with Win95 with JDK 1.4.0 - but with Win2000 it is correct for example.
    My question is - how can it be, that the normal default cell editor does not have this behavior but when I use the line above, it is displayed in the wrong way?- What does the default cell editor in another way than I do it, that it has not this ugly display?
    I would like to look in the sources, but unfortunately I can't find the source code in JDK 1.4.0 - perhaps you have a hint, where to find it.
    greetings Marsian

    It seems the Label doesn't like it, that it is in a GridCell with rowspan = 2
    If it is in a normal cell (no rowspan), it works.
    If I add ColumnConstraints to the gridpane, it kind of works, but the Label still occupies more space than it should.
    Edited by: csh on 19.07.2012 03:51

  • Strange Behavior with gMSA in Server 2012 R2

    Greetings,
    I have been doing some testing with gMSA Accounts in a Server 2012 R2 environment (two separate environments, actually), and I have noticed something very strange that occurred in both environments, which does not appear to be occurring in one of our customer's
    self-managed environments.
    We created a Group Managed Service Account using the following article:
    http://blogs.technet.com/b/askpfeplat/archive/2012/12/17/windows-server-2012-group-managed-service-accounts.aspx
    Everything went smoothly, and the account installs/tests successfully on both of the hosts that we are testing on. I am able to set my services to run under the account, and most of them appear to work fine. I am having some issues with a few of my services,
    and I believe that the strange behavior I am seeing may have something to do with this - described below: 
    As soon as I set the service's Log On Account (via the Log On Tab under the Service's Properties), the entirety of the "Log On" tab changes to "greyed out," and I am unable to change the Log On account back via the GUI (Screenshot
    attached).
    I found that I am able to successfully change the account via Command Line using sc.exe, but the Log On tab remains greyed out! So far, I have found nothing to remedy this, but confirmed that it happens for any service I set to use the gMSA as the Logon
    Account, and that it happens in 2 separate test environments, but not in a Customer's production environment - very strange.
    All servers in this environment are running Server 2012 R2, and domain Functional Level is currently Server 2012.
    I have been unable to find any information online about this behavior, so I am hoping someone has seen this before, and can explain why this is happening.
    Nick

    VIvian,
    Yes, we used the Install-AdServiceAccount gMSA command on each host using the gMSA account, and then ran Test-AdServiceAccount gMSA, which returned "True."
    However, one thing I noticed is that if I run Test-ADServiceAccount gMSA as a Local Administrator, it fails with the following:
    PS C:\Users\Administrator> Test-AdServiceAccount gMSA$
    Test-AdServiceAccount : The server has rejected the client credentials.
    At line:1 char:1
    + Test-AdServiceAccount gMSA$
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [Test-ADServiceAccount], AuthenticationException
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.Security.Authentication.AuthenticationException,Microsoft.A
       ctiveDirectory.Management.Commands.TestADServiceAccount
    If I run Test-ADServiceAccount gMSA as Domain Administrator, it returns true:
    PS C:\Users\Administrator.<domainname>> Test-AdServiceAccount gMSA$
    True
    Is this normal?
    Overall, I think the issue I am running into is at the Application Level, and not a problem with the gMSA, as it appears to be working. (Can Start/Stop services without any issues). I will be investigating my issue further with 3rd-party vendors, unless
    you think there is something wrong with my gMSA accounts based on the information I have provided.
    Nick

  • Strange behavior when I try to match a mpeg2 video with the menu size image

    hello all,
    got a strange behavior when I try to match a mpeg2 video with the menu size image,
    menu size is 1920 x 1080 (photoshop file)
    mpeg2 video 1920 x 1080 (1second 19 frames)
    the idea is to go from the menu link to the next sub menu with a video as transition, using the same image on the video as the menu and then zooming in (in my case through a door) to end up after the zoom in the next level menu.
    I try to achieve a smooth change from the first play menu picture to the video image into the next level menu picture,
    everything works good but when I watch it on the preview mode on the left and right side of the video it shows a black bar at least 15 to 25 pixel wide, that means the video image appears smaller and it causes a little jump what is preety disturbing and can not be sold as a professional work.
    why encore treats the video size and picture differently?
    it's gratful appreciated if somebody who got experience in a transition I mentioned obove posting any solution,
    thankl you all

    Hi all
    I'm having a very similar problem with Encore. My menu items are distorting (a minor but infuriating squashing top and bottom) when previewed.
    Using Encore,PS,AE CS4
    DVD format SD PAL DV widescreen
    I created 3 menu frameworks and 3 video transistions to link them in AE. On the final frame of each transistion in AE I saved the frame with Composition>Save Frame to> Photoshop Layers. In PS i added the button functionality and saved.
    In Encore I use Dynamic link to import AE transistions as timelines and imported each PS menu twice, once as "menu" and once as an asset.
    When I link the timeline transistions to the menu and preview at the point the menu begins the whole image is squashed. When the next transistion is activated the image returns to its original size.
    Thinking it was the use of PS that was causing the menus to distort I used the menu asset directly in the time line. Obviously no menu functionality but also no distortion. The AE transistion flowed straight into the "menu" just as I expected.
    In the properties panel the menu Aspect Ratio 16:9
    The AE transistions PAR is SD PALwidescreen 1.4587.
    I did try the Blu Ray suggestion above but the same distortion was apparent.
    Any suggestions short of squashing the video to match the menu would be welcomed.
    Thanks

  • Strange behavior in a table with dropTarget and delete action

    I am having a strange behavior in a table with drag and drop and action component to delete row.
    Steps:
    Drag the first row to the table and appears in the destination table (works well)
    Select and change the value by 156, appears an error (works fine)
    delete the row, the row disappears (works well)
    Add the first row again and the value is 156 instead of 158 (why ????)
    I guess the error is the deletion that is not correct, but do not know how?
    Can anyone help?
    I add the source code if you see where I'm wrong
    Java class:
    +public class BeanExample {+
    private ArrayList<RowExample> starttValues;
    private ArrayList<RowExample> endValues;
    +public BeanExample() {+
    super();
    +}+
    +public void setStarttValues(ArrayList<BeanExample.RowExample> starttValues) {+
    this.starttValues = starttValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getStarttValues() {+
    +if (starttValues == null) {+
    starttValues = new ArrayList<BeanExample.RowExample>();
    starttValues.add(new RowExample("1", new Number(158)));
    starttValues.add(new RowExample("21", new Number(12565464)));
    +}+
    return starttValues;
    +}+
    +public void setEndValues(ArrayList<BeanExample.RowExample> endValues) {+
    this.endValues = endValues;
    +}+
    +public ArrayList<BeanExample.RowExample> getEndValues() {+
    +if (endValues == null) {+
    endValues = new ArrayList<BeanExample.RowExample>();
    +}+
    return endValues;
    +}+
    +public void validatorExample(FacesContext facesContext, UIComponent uIComponent, Object object) {+
    Number number = (Number)object;
    +if ((number.longValue() % 2) == 0) {+
    FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "ES PAR", "ES PAR");
    throw new ValidatorException(message);
    +}+
    +}+
    +public DnDAction handleDrop(DropEvent dropEvent) {+
    Transferable transferable = dropEvent.getTransferable();
    DataFlavor<RowKeySet> rowKeySetFlavor = DataFlavor.getDataFlavor(RowKeySet.class, "loteDrag");
    RowKeySet rowKeySet = transferable.getData(rowKeySetFlavor);
    +if (rowKeySet != null) {+
    CollectionModel dragModel = transferable.getData(CollectionModel.class);
    +if (dragModel != null) {+
    Object currKey = rowKeySet.iterator().next();
    dragModel.setRowKey(currKey);
    RowExample table = (RowExample)dragModel.getRowData();
    getEndValues().add(new RowExample(table.getId(), table.getValue()));
    return dropEvent.getProposedAction();
    +}+
    +}+
    return DnDAction.NONE;
    +}+
    +public void borrarFila(ActionEvent actionEvent) {+
    endValues.remove(0);            RequestContext.getCurrentInstance().addPartialTarget(FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:t2"));
    +}+
    +public static class RowExample {+
    private String id;
    private Number value;
    +public RowExample(String id, Number value) {+
    super();
    this.id = id;
    this.value = value;
    +}+
    +public void setId(String id) {+
    this.id = id;
    +}+
    +public String getId() {+
    return id;
    +}+
    +public void setValue(Number value) {+
    this.value = value;
    +}+
    +public Number getValue() {+
    return value;
    +}+
    +}+
    +}+JSF
    +<?xml version='1.0' encoding='windows-1252'?>+
    +<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"+
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    +<jsp:directive.page contentType="text/html;charset=windows-1252"/>+
    +<f:view>+
    +<af:document id="d1">+
    +<af:form id="f1">+
    +<af:panelGroupLayout id="pgl1">+
    +<af:table value="#{beanExample.starttValues}" var="row"+
    rowBandingInterval="0" id="t1" rowSelection="single"
    displayRow="selected" contentDelivery="immediate">
    +<af:column sortable="false" headerText="Id" align="start" id="c2">+
    +<af:outputText value="#{row.id}" id="ot1"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c1">+
    +<af:outputText value="#{row.value}" id="ot2"/>+
    +</af:column>+
    +<af:collectionDragSource actions="COPY" modelName="loteDrag"/>+
    +</af:table>+
    +<af:panelCollection id="pc1">+
    +<f:facet name="toolbar" >+
    +<af:toolbar id="dc_t2" >+
    +<af:commandToolbarButton shortDesc="Delete"+
    icon="/imagesDemo/delete_ena.png"
    id="dc_ctb3" immediate="true"
    +actionListener="#{beanExample.borrarFila}"/>+
    +</af:toolbar>+
    +</f:facet>+
    +<af:table value="#{beanExample.endValues}" var="row"+
    +rowBandingInterval="0" id="t2">+
    +<af:column sortable="false" headerText="Id" align="start" id="c3">+
    +<af:outputText value="#{row.id}" id="ot3"/>+
    +</af:column>+
    +<af:column sortable="false" headerText="Value" align="start" id="c4" >+
    +<af:inputText value="#{row.value}" autoSubmit="true" id="it1" validator="#{beanExample.validatorExample}"/>+
    +</af:column>+
    +<af:collectionDropTarget actions="COPY" modelName="loteDrag"+
    +dropListener="#{beanExample.handleDrop}"/>+
    +</af:table>+
    +</af:panelCollection>+
    +</af:panelGroupLayout>+
    +</af:form>+
    +</af:document>+
    +</f:view>+
    +</jsp:root>+

    I think the problem is the validator
    I changed the practical case, I added an InputText to enter new values in the first row.
    +<af:inputText immediate="true" label="new value" id="it2"+
    +valueChangeListener="#{beanExample.newvalue}" autoSubmit="true"/>+
    +public void newvalue (ValueChangeEvent valueChangeEvent) {+
    +String valor = (String)valueChangeEvent.getNewValue();+
    +Number valorNumber=null;+
    +try {+
    +valorNumber = new Number (valor);+
    +} catch (SQLException e) {+
    +}+
    +RowExample example = (RowExample) endValues.get(0);+
    +example.setValue(valorNumber);+
    +example.setId(valorNumber.toString());+
    +RichTable table = (RichTable)FacesContext.getCurrentInstance().getViewRoot().findComponent(id);+
    +RequestContext.getCurrentInstance().addPartialTarget(table);+
    +}+
    Case 1
    I drag the first row to the target table (ok)
    The new row appears (ok)
    Enter the value 77 in the InputText (ok)
    id content and value change (ok)
    Case2
    I drag the first row to the destination table
    The new row appears (ok)
    Change the value of the first row by 80 (ok)
    errors appears (by validator) (ok)
    Enter the value 77 in the InputText (ok)
    the id is changed but the value NO (*KO*)
    I do not understand the behavior
    Edited by: josefuente on 27-oct-2010 16:03

  • Strange behavior with Firefox

    Hi Team,
    I am using HTMLDB V2.0 and Firefox V1.5.0.1. I used wizard to create a report/form application. However, when I press a button to update the form all the buttons line up in a vertical row and I then have to press the same button again.
    My application is 30412 at htmldb.oracle.com. The problem is occurring at page 4. Go to page 3 (2nd tab) and select any record. You will be directed to page 4. Then when you press any button (cancel, create, delete, apply changes) on page 4, page 4 is refreshed and the buttons strangely line up in a vertical column. I then have to press the same button again before the update occurs.
    I have the same report/form setup on pages 1 and 2 and it is working fine on those pages.
    This strange behavior is not occurring in IE. I also notice that the font size is bigger in IE .
    I would appreciate any help you might offer.
    I really enjoy working with HTMLDB.
    Thanks, Andy

    Sorry about that. I removed all the authorization schemes from the application. I also changed the authentication scheme to HTMLDB. Let me know if I need to do something more for you to get access.
    Thanks for looking at it.
    I think it may have something to do with the "button, alternative 3" template from theme 3 that I am using. When I switch to the "button" template from theme 3 then the strange behavior goes away in Firefox.
    Andy

  • Strange behavior with obssocookie on different browser

    Hi,
    I am trying to integrate OAM with our application deployed on WLS. I have set up an IIS proxy server and installed a web gate on it. I have seen a couple of strange behavior
    1) If I try to access some static image file, SSO keeps asking for authentication. It happens for both firefox and IE, but it doesn't happen for chrome though. Looks like for image file request, the obssocookie is not passed correctly. Anyone sees that before?
    2) If I use firefox on the machine where WLS app server is installed to connect to proxy server, if I use hostname in the URL, I don't see the obssocookie. If I use IP address in the URL, I can see obssocookie. If I use IE or any browser from any other machine, obssocookie is always available
    thanks.
    -Wei

    I found it in the document
    B.1 How Logout Works
    The WebGate logs a user out when it receives a URL containing "logout." (including the "."), with the exceptions of logout.gif and logout.jpg, for example, logout.html or logout.pl. When the WebGate receives a URL with this string, the value of the ObSSOCookie is set to "logout."
    The Access System sets an obSSOCookie for each user or application that accesses a resource protected by a WebGate. The obSSOCookie enables users to access resources that are protected by the Access System that have the same or a lower authentication level. Removing the ObSSOcookie causes the WebGate to log the user out and requires the user to re-authenticate the next time he or she requests a resource that is protected by the Access System.
    Well, I havn't got that far in the document:)
    Thanks a lot for your help.
    -Wei

Maybe you are looking for