b>
Классru.sgu.steganography.Entry: class Entry {static void main (String [] args) {frame = new JFrame ("StegoForm");. setContentPane (new
}
}
Классru.sgu.steganography.StegoForm: class StegoForm {static final String CURRENT_DIR_PATH = "D :/"; static final String TEXT_SIZE_LABEL_TEXT = "Available text size =% d";;;; ;;;;;;;;;;;;;;;;; byte [] data; String key = ""; long maxTextByteLength = 0; long writeAreaByteSize = 0; void createUIComponents () {= new JPanel () ; = new JPanel (); = new JButton (); = new JLabel (); = new JFileChooser (new File (CURRENT_DIR_PATH));. setFileFilter (new FileNameExtensionFilter ("Bmp files", "bmp")); = new JButton (); = new JLabel (); = new JButton (); = new JPanel (); = new JTextArea (); = new JScrollPane (writeTextArea); = new JButton (); = new JButton (); = new JTextPane (); = new JScrollPane (readTextPane); = new JButton (); = new JTextField (1); = new JButton (); = new JFileChooser (new File (CURRENT_DIR_PATH));. setFileFilter (new FileNameExtensionFilter ("Txt files "," txt ")); = new JFileChooser (new File (CURRENT_DIR_PATH));
} () {. setDocument (new PlainDocument () {
@ Overridevoid removeUpdate (DefaultDocumentEventchng) {= writeTextArea.getText (). getBytes (). length;
}
@ Overridevoid insertString (int offset, String str, AttributeSetattr) throws BadLocationException {(str == null);. setText (String.format (TEXT_SIZE_LABEL_TEXT, maxTextByteLength - writeAreaByteSize)); ((writeAreaByteSize) < ; = maxTextByteLength) {(char c: str.toCharArray ()) {+ = String.valueOf (c). getBytes (). length;. insertString (offset, str, attr);
+ + offset;
}
}
}
});. setDocument (new PlainDocument () {
@ Overridevoid removeUpdate (DefaultDocumentEventchng) {. removeUpdate (chng);// To change body of overridden methods use File | Settings | File Templates. = keyTextField.getText ();
}
@ Overridevoid insertString (int offs, String str, AttributeSet a) throws BadLocationException {(str == null); = str.substring (0, Math.min (100 - getLength (), str. length ()));. insertString (offs, str, a); = keyTextField.getText ();
}
});. addActionListener (new ActionListener () {
@ Overridevoid actionPerformed (ActionEvent e) {status = imageFileChooser.showOpenDialog (null); (status == JFileChooser.APPROVE_OPTION) {imageFile = imageFileChooser.getSelectedFile (); (imageFile! = null) {( imageFile); = StegoMessenger.getMaximumMessageByteLength (imageFile);. setText (String.format (TEXT_SIZE_LABEL_TEXT, maxTextByteLength));
}
}