java - Reaching JTextField in a DocumentListener -


So, I ended up making a Sudoku Solver, but I want to improve it. To do this, I need to reach betterJTextField to documentListener . I am using a documentListener to read from my betterJTextFields in real-time, I have the problem that insertUpdate (DocumentEvent e) .

I need to reach Better Zest Field that happened to DocumentEvent . For example, if invalid input, would be better zestfield turn red etc.

I have all my better zestfield in the matrix if you should know. Each area handles a number in the Sudoku.

  @ Override public zero inserted (DocumentEvent e) {// Code removed which checks that the input in the fine zest field is OK. }   

( JFormattedTextfield extended JTextField )

  public class betterJeststeffiledJFormattedTextField {private int row; Private int column; Public BetterJustStस्टfield (format format, infinite row, EIT column) {super (format); This.row = Line; This.column = Column; // To-O Auto-Generated Constructor Stub} Public Ent Miller () {return line; } Public int getColumn () {return column; }    

I really can not fully understand what you are saying But I believe that is what you are looking for:

  Personal Static Class RedDocumentListener Document Listener {Private JTextField textField; Public RedDocumentListener (JTextField textField) {this.textField = textField; } @ Override Public Empty Update (DocumentEvent E) {textField.setBackground (Color.red); } @ Override Public DownEvent e {textField.setBackground (Color.red); } @ Override Public Old Replacement Update (DocumentEvent E) {textField.setBackground (Color.red); }}    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -