我需要将JOptionPage转换为JDialog,因为我需要摆脱那个古怪的"OK"按钮.以下是代码......
JOptionPane.showMessageDialog(null, Interface, caption, JOptionPane.WARNING_MESSAGE, icon);
Run Code Online (Sandbox Code Playgroud)
界面是我的GUI,"标题"是标题,然后我有一个警告信息,然后我有我的自定义图标.
对于给定的信息,这可能甚至不可能,但我真的需要摆脱它.任何帮助,将不胜感激.
我有以下代码:
import android.app.Fragment;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.TextView;
public class MainFragment extends Fragment {
protected AlphaAnimation fadeIn = new AlphaAnimation(0.0f , 1.0f );
public MainFragment(){}
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.main_fragment, container, false);
String fontPath = "fonts/roboto.ttf";
Typeface font = Typeface.createFromAsset(getActivity().getAssets(), fontPath);
TextView txt1 = (TextView) rootView.findViewById(R.id.headerTextView);
txt1.setTypeface(font);
TextView txt2 = (TextView) rootView.findViewById(R.id.instructions);
txt2.setTypeface(font);
txt1.startAnimation(fadeIn);
txt2.startAnimation(fadeIn);
fadeIn.setDuration(1400);
fadeIn.setFillAfter(true);
Rect rectangle = new …Run Code Online (Sandbox Code Playgroud)