m Korbel

Ranch Hand
+ Follow
since Jun 19, 2012
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by m Korbel

- use XxxTableModel.setValueAt(string_thats_match_with_JComboBox_Items), then you are set the initial value for XxxTableCellEditor/Renderer


"I can insert a jcombobox in a jtable cell. Is updated by a button. But i cannot select a default object in a combobox."

- your implemetation of TableCellRenderer is wrong, JTable is designated to show value stored in XxxTableModel (see XxxTableModel.setValueAt)

- for more (and to use exclusivelly) information to read Oracle tutorial How to use Tables, part Using a Combo Box as an Editor
8 years ago
- I'd be use BorderLayout for JPanel added to JFrames CENTER area, or to use fill for GBC correctly

- in all cases to override getPreferredSize insted of setPrederredSize

- override getPreferredSize for JScrollPane with JTree too,

- wrap possition for JSplitPane divider into invokeLater

- use JFrame.pack insted of setSize(800, 800); otherwise any PreferredSize will be schinked to Contents Panes Dimension (is smaler than JFrame.setSize(800, 800);)

- create local variable for JFrame too
8 years ago
1. never to block an EDT by Thread.sleep(showImage * 1000); //must double the number mili second, in Java7 and never verson nothing will be repainted in the screen, use Swing Timer exclusivelly, - more in Oracle tutorial Concurency in Swing

2. use ItemListener for JCheckBox //What do I need to change or add here? - more in Oracle tutorial

3. use CardLayout instead of private void bilderSchau() {

4. whats reason(s) for, because paiunting is done in paintComponent by invoking JPanel.repaint(after image is loaded)

//Get the graphic context
Graphics grafikKontext = this.getGraphics();

//Clear the display
grafikKontext.clearRect(0, 0, this.getSize().width, this.getSize().height);

//The method drawImage to show the new output scaled image
grafikKontext.drawImage(bild, 0, 0, (int) neueBildBreite, (int) neueBildHoehe, this);

5. override getPreferredSize for public class BildPanel extends JPanel{, then g.drawImage(bild, 0, 0, (int) neueBildBreite, (int) neueBildHoehe, this); will be getHeight/Weight instead of hunting for (int) neueBildBreite, (int) neueBildHoehe


6. create an JFrame and JDialog(modal true, only one JDialog, reuse for another image by setVisible(true/flase)) for showing an Image with JLabel inside JScrollPane, don't forget to call flush() before ImageIcon/Icon is added to JLabel.setIcon(), - more in Oracle tutorials How to use Labels and Icon
8 years ago
- no idea, there isn't issue in logics, everything depends of code, logics for RowFilter, value stored in both XxxTableModels

- for better help sooner post an SSCCE, short, runnable, compilable, with hardcoded value for XxxTableModel in local variable,
8 years ago
- you have to override TreeCellRenderer, to enlarge the gap between nodes, override getPreferredSize for nested JPanel that returns its Dimension properly back to Painter

- Renderers concept in Swing is just an illlusion with very intensive painting, then you have to override mouse events (convert from SwingUtilities) if you want to switch betweens Cards (conflict with colapsing the node)

- don't to use JTree for this idea, search for Java + Swing + Accordion, or Ribbon, there must be two three very good attempts that is settable


- why you don't do that, one of good attempts
8 years ago
I couldn't understand why JComboBox with big data working slowly. ---> JList has an performance issue together with event from SelectionModel, up to 999 Items is everything ok, without some performance issue

- replace DefaultComboBoxModel at runtime, or override MutableComboBoxModel with selection
8 years ago
- fireTableCellUpdated should be exclusively inside setValueAt,

- getValueAt just to returns value for JTables view
8 years ago
- override setValueAt in AbstractTableModel instead of listening of event from TableModelListener (not designated for)

- overrride getColumnClass in AbstractTableModel instead of parsing from/to

- setValueAt should be contains super.setValueAt
8 years ago
- TableModelListener isn't designated to notify the model itself, never, don't to use for modify value in model, to override setValueAt instead (don't forget fot super.setValue...)

- JTableHeader isn't designated for XxxTableCellEditor, even this is simple, possible, another with mouse events, with good explanations about side effects
8 years ago
- in Swing (reduced for AWT) is just (valid for rest of programming languages and Native OSes) is about if concrete Font to support painting the concrete glyph

- Swing (reduced for AWT) support Html <=3.2 with reduced support for css formating

- different situation is in JavaFX8, there is Html5/css very good implemented, side effect are bugs in JavaFX Components (event, notifier)

8 years ago
apart from i forgot to change the static Baudrate (9600) to the int.

- not, never in Java is possible to hold value in proper data type (Date, Double, Icon, Integet, Long ....), then there isn't some reason to "Integer#parseInt(String s) is your friend"

- isn't some reason to use "parseXxx" in Java

- put int/Integer to DefaultComboModel/JComboBox, then ActionListener returns int/Integer

- various formatting is possible in XxxListCellRenderer
8 years ago