-2

I've got a problem with JTable because recently I began work with Swing and I don't know this API well.

I would like to replace commas with dots in double's cell.

How to do it?

Image

7
  • I created application with jTable and I would like to replace commas with double's
    – MaRsOnIx
    Aug 22, 2017 at 12:48
  • Look at picture in thread. I would like to create event which would replace commas with dots aftert clicked enter or automatically.
    – MaRsOnIx
    Aug 22, 2017 at 12:56
  • Try this can help you stackoverflow.com/questions/30160899/…
    – Abdelhak
    Aug 22, 2017 at 13:10
  • It's work for JField object but I would like do it for column from JTable.
    – MaRsOnIx
    Aug 22, 2017 at 13:21
  • The cell. in Jtable is editable?
    – Abdelhak
    Aug 22, 2017 at 13:41

1 Answer 1

1

I would like to create event which would replace commas with dots aftert clicked enter or automatically.

The data in the cell of a table is displayed by using a renderer. You can use a custom renderer to format the data. Read the section from the Swing tutorial on Using Custom Renderers for basic information about renderers.

So you can create your own custom renderer ore you can check out Table Format Renderer which does most of the work for you. You just provide your custom Format object to the renderer class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.