
i have a string1 it contains 3 parts,for example "123456 service hello" and string2 contains "change request " like this. and the string3 should contain "123456 "........." hello" ".........." can be whatever we give from string2,that should be displayed on the screen. i need logic for this program . i want to apply this to window header part. Thanks in advance

import java.awt.*;
import javax.swing.*;
class Header{
public static void main(String []args){
String st1="123456 service hello";
String arr[]=st1.split(" ");
String st2=JOptionPane.showInputDialog(null,"Enter string2: ");
String st3=st1.replace(arr[1],st2);
JFrame f=new JFrame(st3);
f.setLayout(null);
JLabel l=new JLabel(st3);
l.setBounds(50,10,300,20);
f.add(l);
f.setSize(300,100);
f.setVisible(true);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.