をグラフィック名bufferstrategy.getDrawGraphics
に追加する方法を知っている人はいますか?それは私がそれを編集できませんでした、表示された本家の、JavaのGraphicsにテキストフィールドを追加する
private JTextField Input = new JTextField();
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;
}
final Graphics gCommands = bs.getDrawGraphics();
Graphics gCC = bs.getDrawGraphics();
Input.requestFocus();
Input.paint(gCC);
Input.setBounds(800,250, 350,20);
Input.setBorder(BorderFactory.createLineBorder(Color.BLACK, 0));
Input.setEditable(true);
Input.setBackground(getBackground());
Input.setForeground(getForeground());
Input.addKeyListener(key);
しかし: は、グラフィックスに痛み、それには、このような何かをしようと試みました。 Input.setBounds(800,250, 350,20)
でも動作しませんでした。上記で書かれたこのメソッドは、gameloop内で呼び出されています。誰でも助けてくれますか?
何が問題になりましたか?ランタイムエラーが発生しましたか?それは表示されましたか? – Frecklefoot
'JTextField'は編集できませんでしたが、表示されました – null
クラスはCanvasですか? JFrame? – Tips48